Hello,
I'm using this step (attached above) in one of my pipelines. As you can see we are running the container tests using docker-compose. When using up command the docker-compose will try to check if any image exists locally to run the container, if it doesn't docker-compose will build it first.
I was wondering whether it is possible to push the image build artifact into the bitbucket-pipeline's docker cache so it could be utilized later on different pipeline-executions?
- step:
name: Run Tests
image: docker/compose
services:
- docker
caches:
- docker
script:
- docker-compose -f docker-compose.test.yml up --exit-code-from name
after-script:
# after script because we upload the logs regardless to result of the script (success / failed)
# Get docker containers logs
- mkdir container-logs
- docker-compose -f docker-compose.test.yml logs --no-color > container-logs/logs.log
artifacts:
- container-logs/logs.log
According to the docker service, it seems that it doesn't find the image and therefore it builds it again.
time="2020-07-19T17:27:14Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.30/images/name/json
time="2020-07-19T17:27:14.177152885Z" level=error msg="Handler for GET /v1.30/images/name/json returned error: no such image: name: No such image: name:latest"
Does anyone understand what is the issue?