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