-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix: Dockerfile RUN cache #559
Bugfix: Dockerfile RUN cache #559
Conversation
PR Summary
|
Again, this is a really nice PR. Lets see if the build succeeds this time. |
--mount=type=cache,target=/var/cache/apt \ | ||
# Inspired by https://github.com/reproducible-containers/buildkit-cache-dance?tab=readme-ov-file#apt-get-github-actions | ||
RUN \ | ||
--mount=type=cache,target=/var/cache/apt,sharing=locked \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused why concurrent access was even possible. I was under the impression that these are two totally different machines/vms and don't share anything, let alone disk. Where is this cache being saved to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As explained here https://docs.docker.com/reference/dockerfile/#run---mounttypecache by default the parameter RUN --cache sharing
is shared
, meaning that the arm64
and amd64
builds, running in parallel inside the same GitHub runner (here is a quick overview of the multi-platform build done by Docker) will conflict with each other.
Following the introduction of the Dockerfile RUN cache in #554 , the build has started failing, likely due to concurrent access to the same cached folder during the multi-architecture build process: https://github.com/mediagis/nominatim-docker/actions/runs/8722047757
This PR does the following:
docker/metadata-action@v5
to define the Docker label and tag for the imagedocker build
is always done in the CI pipeline, so that the arm64 build is also built, but only pushed to Dockerhub if on themaster
branch