ruby icon indicating copy to clipboard operation
ruby copied to clipboard

Strip all binaries for slim images

Open orgads opened this issue 1 year ago • 11 comments

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

orgads avatar Sep 05 '24 19:09 orgads

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.

sdwolfz avatar Sep 06 '24 08:09 sdwolfz

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 avatar Sep 06 '24 08:09 orgads

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

orgads avatar Sep 06 '24 10:09 orgads

@sdwolfz 👆🏻

orgads avatar Sep 10 '24 09:09 orgads

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.

sdwolfz avatar Sep 10 '24 13:09 sdwolfz

  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.

orgads avatar Sep 10 '24 13:09 orgads

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

LaurentGoderre avatar Sep 10 '24 13:09 LaurentGoderre

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

orgads avatar Sep 10 '24 19:09 orgads

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 https://github.com/docker-library/php/issues/1538 (and linked issues), so I'm hesitant to opine on whether this is generally reasonable for us to do.

tianon avatar Sep 10 '24 21:09 tianon

You can create another image variant with -debug.

Have you ever used the debugging symbols in the image?

orgads avatar Sep 11 '24 00:09 orgads

Rebased. Ping?

orgads avatar Aug 04 '25 05:08 orgads