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

2 answers

1 vote
Graham Gatus
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 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.

0 votes
Seth Miller November 11, 2020

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events