My pipelines config:
image: php-fpm:7.3
pipelines:
branches:
master:
- step:
name: Install dependecies
image: composer
script:
- echo "Running composer in $(pwd)"
- composer install --ignore-platform-reqs
caches:
- composer
artifacts:
- vendor/**
- step:
name: Build and push to registry
image: docker
script:
- docker info
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD $DOCKER_HUB_HOST
- docker build -t $DOCKER_HUB_HOST/km-backend:latest .
- docker push $DOCKER_HUB_HOST/km-backend:latest
services:
- docker
caches:
- docker
On "Build and push to registry" step I can see the following messages:
Artifact "vendor/**": Downloading
Artifact "vendor/**": Downloaded 12.6 MiB in 3 seconds
Artifact "vendor/**": Extracting
Artifact "vendor/**": Extracted in 0 seconds
Cache "docker": Downloading
Cache "docker": Downloaded 252.7 MiB in 7 seconds
Cache "docker": Extracting
Cache "docker": Extracted in 4 seconds
But then it runs "docker build" command and ignores "docker" cache, installing everything again. My Dockerfile is pretty big and it contains many additional steps for building various PHP components, so it takes up to 7-8 minutes to build it after every commit. This is a very inefficient usage of resources, but I cannot figure out what am I doing wrong, so any help would be greatly appreciated.
Thank you.