Skip to content
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

Decrease docker image size by 200MB #3540

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

duboisf
Copy link

@duboisf duboisf commented Nov 5, 2024

200MB saved for each image pull times probably a bazillion pulls == lots of bandwidth saved? 😁

The dockerfile was originally copying and then deleting the docker directory in 2 steps. This creates a "whiteout" that hides the docker directory in the previous layer. Alas, the original docker folder is still present (and takes up space, 200MB to be precise) in the previous layer.

To fix this, we uncompress the docker.tgz in the /tmp directory to be able to copy the docker binaries directly to their target destination.

$ docker images | grep actions | grep 2.320        
ghcr.io/duboisf/actions-runner         2.320.1-beta    18404fab5680   17 minutes ago   1.2GB
ghcr.io/actions/actions-runner         2.320.0         1ad90d9a13d2   4 weeks ago      1.4GB

dive differences:

image

@duboisf duboisf requested a review from a team as a code owner November 5, 2024 19:23
@duboisf duboisf marked this pull request as draft November 5, 2024 19:23
@duboisf
Copy link
Author

duboisf commented Nov 6, 2024

Tested with our self-hosted runners, so far so good.

@duboisf duboisf marked this pull request as ready for review November 6, 2024 00:34
Copying and then deleting the docker directory in 2 steps (therefore,
layers) means the docker directory is still present in the previous
layer.

We uncompress the docker.tgz in the /tmp directory to be able to copy
the docker binaries directly to their target destination.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant