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

Minor dockerfile optimizations #240

Merged
merged 3 commits into from
Aug 28, 2024

Conversation

emonty
Copy link
Contributor

@emonty emonty commented Jun 14, 2024

Micro-optimizations for the Docker images. In the builder image we don't need all of build-essential, that is for package maintainers. We also don't need to install -dev packages in the final image, because we don't need headers and docs. Net result is slightly snappier build the first time, and a 25% reduction in final image size.

emonty added 3 commits June 14, 2024 08:37
build-essential is overkill, it pulls in all of the tools one needs to
make to build debian packages, which we are not doing. Even though this
is a builder image, it still takes time to download all the extra crud.

Replace build-essential with make gcc and g++, which are all that are
needed.
The dev packages are only needed in the builder image. They add header
files and docs and things that are not needed in the final image.

Removing them and replacing them with just the runtime libraries reduces
the final image size by about 25% (160M->124M) in a local build.

Additionally, just for simplicity, zlib1g is already part of base
ubuntu minimal, so we don't even have to list it.
Just like the in Dockerfile, people don't need all of those packages
to build directly on their system.
@emonty
Copy link
Contributor Author

emonty commented Jun 14, 2024

Thanks for taking over maint! I had a PR with the builder image updates you already added and these bits against the mapbox repo since 2020. 😁

Copy link
Collaborator

@e-n-f e-n-f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the improvements!

@e-n-f e-n-f merged commit f3b575e into felt:main Aug 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants