Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×Hi,
I have a setup where I run some docker images from within the Bitbucket Pipelines build (they are testcontainers, i.e. the docker images are started from within the pipeline, sort of docker-in-docker setup).
One of the images I'm using is mounting a subdirectory of BITBUCKET_CLONE_DIR inside the container and tries to create a file there. This fails, causing the whole build to fail.
I've come across this discussion: https://community.atlassian.com/forums/Bitbucket-questions/Bitbucket-pipelines-how-can-I-map-a-volume-to-docker-to-expose/qaq-p/686951
However, that only discusses creating directories from withint such a docker image, not files.
I've created a simple test Dockerfile to verify this behavior and creating files indeed seems to fail:
FROM node:20
USER 0
RUN mkdir /srv/firebase
RUN mkdir /srv/firebase/kantoordag-next
VOLUME /srv/firebase/kantoordag-next
WORKDIR /srv/firebase/kantoordag-next
ADD testme.sh /srv/testme.sh
RUN chmod +x /srv/testme.sh
CMD /srv/testme.sh
And testme.sh is:
#!/bin/sh
who
ls -la /srv/firebase/kantoordag-next
ls -la /srv/firebase/kantoordag-next/node_modules
ls -la /srv/firebase/kantoordag-next/node_modules/.vite-temp
touch /srv/firebase/kantoordag-next/node_modules/.vite-temp/testme || echo "Failed"
echo "Testme creation:"
ls -la /srv/firebase/kantoordag-next/node_modules/.vite-temp
Welcome to the community!
I need to see your pipeline YML to understand how you're mounting the volume and identify the failure. Since this is public, I recommend raising a Support ticket on our Support portal for further investigation.
Regards,
Syahrul
Hi,
The mounting is actually not done from the pipeline YML, but from the testcontainer which is run. The mounting is performed in the Quarkus Firebase Devcontainer TestContainer image. The exact code which performs the mounting is at:
(Note that this issue is triggered by the first mount being performed in this case, but that might just be a timing issue).
I am the co-developer of this extension btw, so we can discuss if anything needs to be changed to work on Bitbucket. Given the origin of the extension, it started out being used on Github, but I am now using it for some repo's running on BB, so trying to get it running there would be great.
KR
Jeroen
ps: late reply, vacation time interfered..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeroen,
Bitbucket Pipelines have some limitations. To mount a volume, you need to use BuildKit because of restrictions, as mentioned in 'Run Docker commands in Bitbucket Pipelines.'
Please find the following example:
options: docker: true size: 2x # Optional: increase resources if needed pipelines: default: - step: name: Build and Run Testcontainer services: - docker script: - export DOCKER_BUILDKIT=0 - mkdir -p ./srv/firebase/kantoordag-next - chmod -R 777 ./srv/firebase/kantoordag-next - docker-compose up --build --abort-on-container-exit
Hope this helps
Regards,
Syahrul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Up until to the point that it didn't...
Had a working build, squashed the commits up to that point to clean up the git history, and now it stopped working... I'm at a loss here..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The correct way to solve this is use cloud v3: https://support.atlassian.com/bitbucket-cloud/docs/enable-and-use-runtime-v3/
Resolved with the help op the support guys
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.