docs: keep custom image layers across refreshes #75
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "docs/custom-image-layer-cache"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Azkaban lets a workspace carry its own image layer, a
Dockerfile.azkabanor
Dockerfile.<client>, built on the installed client image at eachlaunch. On Linux amd64 and arm64 a launch rebuilds the client image
whenever the published base changes, which is every night, and every
layer of the workspace file sits on it: whoever follows the documented
examples rebuilds all their apt installs, runtimes, and compiled
dependencies on the first launch of each day, and the documentation
says only that "the affected layers" rebuild.
Issue #74 proposed building the workspace file on the base and the
client on top of it. That was set aside: the base itself changes every
night, so the workspace layers would still rebuild nightly, and the
change would break the documented
USER 1000contract. A workspacefile can already keep its heavy layers with a multi-stage shape, so the
documentation now shows it.
Refs #74
What changed
Before, a reader of Custom images saw only single-stage examples and a
cache sentence that suggested partial reuse after a client refresh. Now
the sentence says a refreshed client image rebuilds every layer built
on it, and a new section, "Keeping heavy layers across refreshes",
shows a file whose first stage names the client, whose heavy work runs
in a stage on
ubuntu:26.04, and whose last stage copies the resultsin and ends with
USER 1000; it says which work fits, that only theshared file's first
FROMis replaced, and thatpodman image prunedrops the cached stage. Troubleshooting gains the symptom of a custom
image that rebuilds in full each day. The launcher is unchanged.
How to verify
Have rootless Podman (checked with 5.7.0) on Linux, and network
access to
docker.io.The problem and the solution, in a private image store that leaves
your own images alone:
The first two stamps are equal: the
toolsstage stayed cachedacross a client refresh. The third differs: the prune dropped it.
Moving the
RUNinto the client stage instead makes every stampdiffer, which is what the old examples give.
make lint,.agents/hooks/shellcheck.sh repo, andmake testpasson the tip. These condensed steps were not run as written, since the
authoring machine has no Podman; a longer script with the same builds,
refresh, and prune ran on Podman 5.7.0 with the results above. The Apple
containerengine on macOS was not available, and the section says itsreuse is unchecked.
Considerations
"On Podman" covers releases other than the 5.7.0 that was checked; a
reviewer rated this low and it was left as is.