I have setup custom composer cache and its working fine and it looks something like this.
definitions:
services:
docker:
memory: 3072
caches:
sonar: ~/.sonar/cache
composer-custom: /composer/cache
and my build step looks something like this
- step: &build-api-docker-test-image
name: Build API docker test image
services:
- docker
caches:
- composer-custom
- docker
script:
- export DOCKER_BUILDKIT=1
- export IMAGE_TAG=$BITBUCKET_COMMIT
- export API_IMAGE_NAME=$API_DOCKER_IMAGE_NAME:latest
- docker build --file .docker/test/Dockerfile -t $API_IMAGE_NAME --build-arg BITBUCKET_KEY=${BITBUCKET_USERNAME} --build-arg BITBUCKET_SECRET=${BITBUCKET_READ_ACCESS_SECRET} .
- docker save --output tmp-api-image.test.docker $API_DOCKER_IMAGE_NAME
artifacts:
- tmp-api-image.test.docker
now when i try and run pipeline composer custom is always not found. because my composer install is creating files in my container. I am unable to use mount either due to restrictions.