Replies: 1 comment 2 replies
-
|
So, apparently, this is specific to my machine (Arch Linux, containerd 1.6.5, docker 20.10.16). Coworkers on Ubuntu and Fedora (both containerd 1.6.6, docker 20.10.17) both have the huge layer. Anyway, I'd love to understand what's happening behind the hood, and even better understand the difference between my machine and others. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm building a Docker image (not using the official ones, making my own using a similar process: create user, download distribution from GitHub, validate checksum, untar), using a base image with just the unpacked distribution, and then a more specific image that calls
kc.sh build --db postgres --health-enabled true --metrics-enabled true.When I build the Docker image locally (from the base image deployed to our registry), that step creates a 1.1MB layer that only modifies the files in
$KEYCLOAK_HOME/lib/quarkus/.However, when the image is built on our CI server, the layer is 192MB ‼ Looking at it with dive, it tells me many (if not all) JARs in
$KEYCLOAK_HOME/lib/lib/live in 2 layers, creating waste; this means that thekc.sh buildhas somehow copied them to the new layer, but the "current layer content" view doesn't show them, which means their content is identical and only file system attributes have changed (I haven't found which one would have changed though:getcap -nrvdoesn't list anything, andls -llists the same dates, owner, and permissions).Because the layer was only 1.1MB on my machine, I didn't bother using a multi-stage build like suggested in the docs (and because they're a PITA to correctly cleanup after build, I'd rather keep it that way), but 192MB is a whole different matter!
Anyone knows what
kc.sh build(i.e. a Quarkus build) does exactly that could explain that?Beta Was this translation helpful? Give feedback.
All reactions