Closed brianstorti closed 1 year ago
I was missing the BUILDKIT_INLINE_CACHE
build arg:
steps:
- label: ":docker: Build image"
plugins:
- docker-compose#v4.13.0:
cli-version: 2
build: rails
image-repository: us-east4-docker.pkg.dev/myrepo/core-buildkite
args:
- BUILDKIT_INLINE_CACHE=1 # <-- This
cache-from:
- rails:us-east4-docker.pkg.dev/myrepo/core-buildkite:${BUILDKITE_BRANCH}
- rails:us-east4-docker.pkg.dev/myrepo/core-buildkite:latest
I'm trying to reuse a previously built docker image so new agents don't need to build the image from scratch every time (docs), but that doesn't seem to be working as expected.
It seems like the image is being pulled, and the docker-compose file is being modified with a
cache_from
that should make it use the image, but it always builds the image again:Here's the config I have:
I can see the image is being correctly pushed to the remote registry, and it's also pulled as expected. I can even see that when I'm pushing this image, all the layers already exist, so I'm not sure why they are not being used when I'm building the image:
Am I missing something?