I'm trying to mount some volumes in my pipeline as part of docker-compose up. I was originally using $PWD to mount volumes relative to the directory the docker-compose files were in, but I keep running into the following error:
ERROR: for db Cannot create container for service db: authorization denied by plugin pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectories
This occurs even after changing the volume to be explicitly underneath the directory bitbucket is cloning into. I've run echo $PWD in the pipeline to see that it's building in
<span><br>/opt/atlassian/pipelines/agent/build</span><span>+ echo $PWD</span>
But even after explicitly setting my volume underneath this directory, I still get the above error.
Here's the relevant section of my docker-compose:
version: '3'
services:
db:
image: mongo:latest
container_name: db
ports: - "27017:27017"
volumes: - db-data:/data/db
volumes:
db-data:
driver: local
driver_opts:
type: none
device: /opt/atlassian/pipelines/agent/build/server/db
o: bind
The only other thing that could be relevant is that the server dir is a submodule, but I'm cloning it successfully because it's running the docker-compose file and doing an ls in the pipeline reveals that all the files and folders are there.
Any help on this would be great, I've been stumped on this for a whole day.