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

Reduce default Docker image size in 7.x #75079

Merged
merged 3 commits into from
Jul 22, 2021

Conversation

pugnascotia
Copy link
Contributor

The centos:8 image hasn't been updated for a while, and now the image
layer for updating it via yum is larger than the base image. Address
this by adopting the strategy for 8.0, where we build a custom base
image from centos:8 and use that instead. The implementation here
differs in that yum is still available in the custom image, making it
more like the CentOS image, and therefore less breaking than the 8.0
changes.

Before: 1.04GB
After: 806MB

The `centos:8` image hasn't been updated for a while, and now the image
layer for updating it via `yum` is larger than the base image. Address
this by adopting the strategy for 8.0, where we build a custom base
image from `centos:8` and use that instead. The implementation here
differs in that `yum` is still available in the custom image, making it
more like the CentOS image.

This work saves roughly 200MB.
@pugnascotia pugnascotia added >enhancement :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts v7.15.0 labels Jul 7, 2021
@elasticmachine elasticmachine added the Team:Delivery Meta label for Delivery team label Jul 7, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-delivery (Team:Delivery)

@pugnascotia
Copy link
Contributor Author

Also FYI @mieciu

Copy link
Contributor

@mieciu mieciu left a comment

Choose a reason for hiding this comment

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

A non-binding LGTM from my side 🙃 Thanks for the heads up!

Copy link
Contributor

@mark-vieira mark-vieira left a comment

Choose a reason for hiding this comment

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

👍

Is basically the only difference between 7.x and master now is that the former additionally includes yum?

@pugnascotia
Copy link
Contributor Author

@mark-vieira Kind of - we don't build a static curl either, but 7.x and master are more closely aligned now.

@pugnascotia pugnascotia merged commit d581766 into elastic:7.x Jul 22, 2021
@pugnascotia pugnascotia deleted the reduce-docker-size-7x branch July 22, 2021 15:41
@pugnascotia
Copy link
Contributor Author

@mieciu I've merged this PR, can you confirm that I haven't broken Cloud?

pugnascotia added a commit to pugnascotia/elasticsearch that referenced this pull request Aug 19, 2021
Closes elastic#76695.

Due to a Kubernetes quirk, we need to ensure that the `tar` CLI tool is
present in the Docker image. It was removed in elastic#75079 because we
reworked how the image was built, and anything not explicitly installed
was left out.
pugnascotia added a commit that referenced this pull request Aug 19, 2021
Closes #76695.

Due to a Kubernetes quirk, we need to ensure that the `tar` CLI tool is
present in the Docker image. It was removed in #75079 because we
reworked how the image was built, and anything not explicitly installed
was left out.
pugnascotia added a commit that referenced this pull request Aug 19, 2021
Closes #76695.

Due to a Kubernetes quirk, we need to ensure that the `tar` CLI tool is
present in the Docker image. It was removed in #75079 because we
reworked how the image was built, and anything not explicitly installed
was left out.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts >enhancement Team:Delivery Meta label for Delivery team v7.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants