Repository navigation
Share the game layer between the amd64 and arm64 images - #59
Merged
Merged
Conversation
The release builds the amd64 image for its smoke test first, then both platforms, reusing that amd64 build. The game's COPY layer was diffed against each platform's JRE, so the two copies of the same 184 MB of jars got different digests, and ghcr.io stored the game twice per release, as 0.9.2 shows. COPY --link builds the layer on its own, so both platforms use one blob. Podman builds the image with --link too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The bitmap image stores the game once per release instead of twice. In 0.9.2, the amd64 and arm64 images each carry their own 184 MB game layer, with different digests for the same jars, so ghcr.io holds 368 MB of game per release.
COPY --linkmakes both platforms share one layer.Why the copies differed
The release builds the amd64 image on its own for the smoke test, then builds both platforms, reusing that amd64 build. A plain
COPYlayer is diffed against the image under it, so it records/appas it was in each platform's build, built minutes apart. That gives two layers with the same files but different digests, along with two differentWORKDIRlayers, as in 0.9.2.COPY --linkbuilds the layer on its own, independent of the image under it.Testing
moby/buildkitv0.23.2:--link, amd64 and arm64 get different game layers, as in 0.9.2;--link, they share one layer../rylween serveuses without Docker: builds the realDockerfile.bitmapwith--link. The image serves/healthz, the login page, and prints its link.Releases after this one still add a new game layer each time, since the paintings and audio ship inside the game jar. Moving them into their own layer is a separate change.