It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Cannot create container for service db: authorization denied by plugin pipelines: -v

Deleted user May 28, 2019

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 ... errorERROR: for build_db_1  Cannot create container for service db: authorization denied by plugin pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectoriesERROR: for db  Cannot create container for service db: authorization denied by plugin pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectoriesEncountered 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

1 answer

1 vote
Graham Gatus Atlassian Team Jun 26, 2019

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.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,051 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you