Hello, i'm running a pipeline that looks like this:
`image: docker/compose:1.24.0
options: docker: true
pipelines:
default:
- step: name: test
caches:
- docker
- composer
services:
- docker
script:
- docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
- docker-compose -f docker-compose.yml -f docker-compose.dev.yml exec web ./test all
- docker-compose -f docker-compose.yml -f docker-compose.dev.yml down -v
`
but i get the following error:
Image for service web was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating build_db_1 ...
Creating build_db_1 ... error
ERROR: for build_db_1 Cannot create container for service db: authorization denied by plugin pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectories
ERROR: for db Cannot create container for service db: authorization denied by plugin pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectories
Encountered errors while bringing up the project.
my docker-compose file contains a DB service that looks like this:
`
db:
image: bitnami/postgresql:11
ports:
- 5432
environment:
- POSTGRESQL_USERNAME=${POSTGRES_USER:-random}
- POSTGRESQL_PASSWORD=${POSTGRES_PASSWORD:-random}
- POSTGRESQL_DATABASE=${POSTGRES_DATABASE:-random}
volumes:
- pgdata_folder:/bitnami/postgresql
- ./utility:/utility
networks:
- backend
`
Any idea on what is this problem exactly about or how to fix it? the descfription does not make sense to me at all
It looks like the issue here is with the pgdata_folder, try adding a ./ prefix to it so the volume list looks like:
volumes:
- ./pgdata_folder:/bitnami/postgresql
- ./utility:/utility
Pipelines restricts docker from mounting volumes from outside of the $BITBUCKET_CLONE_DIR directory. I did some experimentation and found that without the ./ (current directory) prefix, the pgdata_folder was being mounted from under a docker owned location, outside of $BITBUCKET_CLONE_DIR.
Check out this workaround, it's hack for sure, but it might get you unstuck: https://community.atlassian.com/t5/Bitbucket-questions/Bitbucket-pipelines-How-can-I-share-a-volume-between-two/qaq-p/1212083#M56779
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.