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

Strip all binaries for slim images #472

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

Conversation

orgads
Copy link

@orgads orgads commented Sep 5, 2024

Reduces slim-bookworm image from 180M to 155M.

@sdwolfz
Copy link
Contributor

sdwolfz commented Sep 6, 2024

This might be something you would do for the slim variants, but please don't do this for every image. Alpine is already slim enough.

Reduces slim-bookworm image from 180M to 155M.
@orgads orgads changed the title Strip all binaries Strip all binaries for slim images Sep 6, 2024
@orgads
Copy link
Author

orgads commented Sep 6, 2024

This might be something you would do for the slim variants, but please don't do this for every image. Alpine is already slim enough.

Sure, done.

@orgads
Copy link
Author

orgads commented Sep 6, 2024

Though the size reduction for alpine is even better in percentage: 90M -> 67M. Is there a reason not to strip?

@orgads
Copy link
Author

orgads commented Sep 10, 2024

@sdwolfz 👆🏻

@sdwolfz
Copy link
Contributor

sdwolfz commented Sep 10, 2024

Sorry but you should await feedback from @tianon here. My point is, slim images are designed to be small, but the non slim ones, if a linux binary is expected on the live system, then people will also expect it in the docker image, so this might break people's expectations.

@orgads
Copy link
Author

orgads commented Sep 10, 2024

  1. alpine is slim by design
  2. What do you mean by expecting a linux binary? I didn't delete anything here, only stripped debugging symbols. All package managers do this.

@LaurentGoderre
Copy link
Member

This might be a breaking change so it might be bettter to do for a new version.

@orgads
Copy link
Author

orgads commented Sep 10, 2024

What do you mean by a new version? Aren't the docker images tagged separately?

@tianon
Copy link
Member

tianon commented Sep 10, 2024

The difference with package managers is that they typically provide something like dbgsym packages that can reinclude the debugging symbols external to the binaries, which is very difficult for us to provide effectively, as seen/discussed in docker-library/php#1538 (and linked issues), so I'm hesitant to opine on whether this is generally reasonable for us to do.

@orgads
Copy link
Author

orgads commented Sep 11, 2024

You can create another image variant with -debug.

Have you ever used the debugging symbols in the image?

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.

4 participants