Hi. I'm currently trying to use bitbucket pipelines to build our (existing) repositories.
We have some code that relies on docker-compose + testcontainers-java in the failsafe tests of the maven builds.
The default way testcontainer executes docker-compose is by running docker/compose as a docker container, mounting /var/run/docker.sock as a volume along with the compose file(s) in question (located in subdirs of $BITBUCKET_CLONE_DIR)
I've tried satisfying the bind mount limitation by creating temporary .docker/config.json file under $BITBUCKET_CLONE_DIR but
In my case I think the docker run command executed by testcontainer is something along the lines of:
docker run \
-e DOCKER_CONFIG_FILE=/opt/atlassian/pipelines/agent/build/.docker/config.json \
-e COMPOSE_FILE=/opt/atlassian/pipelines/agent/build/path/to/compose/dir/docker-compose.yml \
-v /opt/atlassian/pipelines/agent/build/path/to/compose/dir:/opt/atlassian/pipelines/agent/build/path/to/compose/dir \
-v /opt/atlassian/pipelines/agent/build/.docker/config.json:/root/.docker/config.json \
docker/compose:1.24.1 up -d
The error I get is:
Caused by: com.github.dockerjava.api.exception.BadRequestException:
{"message":"OCI runtime create failed: container_linux.go:344: starting container process caused \"
process_linux.go:424: container init caused \\\"
rootfs_linux.go:58:
mounting \\\\\\\"/opt/atlassian/pipelines/agent/build/.docker/config.json\\\\\\\"
to rootfs \\\\\\\"/var/lib/docker/165536.165536/overlay2/b20fb63c68c50b0fda49a93e9fc515419c9312569a8108f8a9f9f6c2eb65d9c5/merged\\\\\\\"
at \\\\\\\"/root/.docker/config.json\\\\\\\"
caused \\\\\\\"
stat /opt/atlassian/pipelines/agent/build/.docker/config.json:
permission denied
\\\\\\\"
\\\"
\": unknown"}
The way it's currently going, I will likely give up and use another CI/CD tool
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.