Clarity about $BITBUCKET_CLONE_DIR - I keep getting errors

dgullo March 18, 2020

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

dgullo May 1, 2020

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 # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events