Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Clarity about $BITBUCKET_CLONE_DIR - I keep getting errors

I keep getting error

ERROR: for build_composer_1 Cannot create container for service composer: authorization denied by plugin pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectories

I have seen similar posts/errors to this one such as

https://community.atlassian.com/t5/Bitbucket-questions/Error-in-pipeline-authorization-denied-by-plugin-pipelines/qaq-p/884514

but I cannot see a clear guideline on how to fix the error.

My build file

image: diegogullo/docker-image-extras

options:
docker: true

pipelines:
default:
- step:
script:
- ls -la
- pwd
- echo $BITBUCKET_CLONE_DIR
- make tests_ci

make tests_ci runs command 

docker-compose -f docker-compose.ci.yml run --rm php5 bash -c "vendor/bin/phpunit --bootstrap app/protected/tests/bootstrap.php app/protected/tests/"


and the docker-compose.ci.yml is

version: '3.7'

services:
php5:
build: docker/php5
ports:
- "9000"
volumes:
- ./docker/config/php.ini:/usr/local/etc/php/php.ini
- websrc:/var/www/html/:z
depends_on:
- composer
environment:
- DB_DATABASE
- DB_USERNAME
- DB_PASSWORD
- DB_HOSTNAME
- LOCAL_DEV=true

composer:
build: docker/composer
user: $UID
environment:
- HOME=/home/composer
volumes:
- websrc:/app
command: composer install
working_dir: /app

volumes:
websrc:
driver: local
driver_opts:
o: bind
type: none
device: $PWD

Given


+ pwd
/opt/atlassian/pipelines/agent/build 


and

+ echo $BITBUCKET_CLONE_DIR
/opt/atlassian/pipelines/agent/build

could you please suggest what I need to change to make things work on bitbucket?
the files are definitely loaded under the current build directory

1 answer

1 accepted

0 votes
Answer accepted
mkleint Atlassian Team Apr 20, 2020

please see https://jira.atlassian.com/browse/BCLOUD-17592 for problem description and workaround.

named volumes are currently not supported by the docker authorization plugin we have installed for security reasons.

In the caching specifications 

https://confluence.atlassian.com/bitbucket/caching-dependencies-895552876.html

for composer for instance the path is `~/.composer/cache`

This is outside the 

$BITBUCKET_CLONE_DIR

so will i be able to mount this on a composer container in docker or is this also going to trigger an error. 

It would be nice to use caching for composer but looks like the caching is not happening in the build directory but instead under the user directory?

Like trebuchet-sam likes this

Suggest an answer

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

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,717 views 10 16
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