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 docker image size #182

Merged
merged 5 commits into from
Jul 8, 2023
Merged

Conversation

edeNFed
Copy link
Contributor

@edeNFed edeNFed commented May 28, 2023

This PR changes the base image to be gcr.io/distroless/base
Image size before the change: 172MB
Image size after the change: 23.8MB

@edeNFed edeNFed requested a review from a team May 28, 2023 14:06
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@MikeGoldsmith
Copy link
Member

We have set dependency requirements for the runtime image, maybe looking to build our own using the ChainGuard image as a guide would be better? Then we'd at least be in control of dependency updates and publish schedules & versioning.

@edeNFed
Copy link
Contributor Author

edeNFed commented Jul 6, 2023

@pellared @MrAlias
This is ready for another review.
Changed from the Chainguard image to Google distroless and used the sha256 digest as version

@edeNFed edeNFed requested a review from pellared July 6, 2023 11:44
Copy link
Member

@dineshg13 dineshg13 left a comment

Choose a reason for hiding this comment

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

LTGM

@MrAlias
Copy link
Contributor

MrAlias commented Jul 6, 2023

For reference, I think this is the repository the images are generated from: https://github.com/GoogleContainerTools/distroless

@MrAlias
Copy link
Contributor

MrAlias commented Jul 6, 2023

It looks like there are support timelines: https://github.com/GoogleContainerTools/distroless/blob/main/SUPPORT_POLICY.md

@MrAlias
Copy link
Contributor

MrAlias commented Jul 6, 2023

Docs:

Image Contents

This image contains a minimal Linux, glibc-based system. It is intended for use directly by "mostly-statically compiled" languages like Go, Rust or D.

Statically compiled applications (Go) that do not require libc can use the gcr.io/distroless/static image, which contains:

  • ca-certificates
  • A /etc/passwd entry for a root user
  • A /tmp directory
  • tzdata

Most other applications (and Go apps that require libc/cgo) should start with gcr.io/distroless/base, which contains all
of the packages in gcr.io/distroless/static, and

  • glibc
  • libssl
  • openssl

Dockerfile Outdated Show resolved Hide resolved
Co-authored-by: Tyler Yahn <[email protected]>
@edeNFed edeNFed merged commit eaf222a into open-telemetry:main Jul 8, 2023
10 checks passed
@edeNFed edeNFed deleted the reduce-image-size branch July 8, 2023 06:45
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.

6 participants