devops : reduce Vulkan Docker image to 39.4% of its original size (now 692 MB) - #4038
Open
turicas wants to merge 5 commits into
Open
devops : reduce Vulkan Docker image to 39.4% of its original size (now 692 MB)#4038turicas wants to merge 5 commits into
turicas wants to merge 5 commits into
Conversation
Also: - Replace apt-get with apt - Explicitly install ca-certificates
Won't copy compiled tests, source code and other build artifacts.
With this change, arguments passed to `docker run` are forwarded directly to the selected command. Having `bash -c` in the entrypoint will cause additional arguments to be interpreted according to shell command-string semantics, which makes commands such as model downloaders and CLI tools behave unexpectedly unless `--entrypoint` is specified explicitly or the whole command is quoted. Removing it restores the conventional Docker behavior of: `docker run IMAGE COMMAND ARG...` passing `ARG` to `COMMAND` (not to `bash`).
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.
The current Vulkan Docker image is 1.75 GB. Making it smaller not only reduces download and storage requirements, but can also make the image faster to build and distribute. This PR applies 4 changes to
main-vulkan.Dockerfile, reducing the final image size from 1.75 GB to 692 MB (39.4% of the original size). The build time also decreased from 2m41s to 2m16s (84.4% of the original).These were the main contributors to the current image size:
base.enmodel)I also made a couple of improvements:
aptinstead ofapt-getbash -cas the entrypointI'm willing to apply the same changes to the other Dockerfiles in the repository if the maintainers approve this approach. I started with the Vulkan image because it's the one I use.
Result:
Notes:
libsdl2-dev(removed in the second commit): commit bea43e0 (not mine) introduced this package in the runtime image, but since it's not required for production use, I think it should instead be installed by users who need it in an image derived from this one.docker runcommands from the README using the final Dockerfile in this PR and everything worked as expected (the examples were also fixed/extended).