Skip to content

Alpine libffi-dev package doesn't allow purge of linux-headers #492

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

Closed
stevecrozz opened this issue Jan 7, 2025 · 1 comment · Fixed by #493
Closed

Alpine libffi-dev package doesn't allow purge of linux-headers #492

stevecrozz opened this issue Jan 7, 2025 · 1 comment · Fixed by #493

Comments

@stevecrozz
Copy link
Contributor

libffi-dev depends on linux-headers.

libffi-dev is installed here, but brings in linux-headers

libffi-dev \

linux-headers is installed here as a Ruby build dependency:
https://github.com/docker-library/ruby/blob/master/3.4/alpine3.21/Dockerfile#L51

And we attempt to remove all the build dependencies here, but can't be deleted because libffi-dev is still installed:
https://github.com/docker-library/ruby/blob/master/3.4/alpine3.21/Dockerfile#L132

But linux-headers cannot be removed because it remains a dependency of libffi-dev. Is the package libffi-dev really a runtime dependency? It seems like it would mainly be needed for compiling gems with C extensions and doesn't need to persist, taking up space in the image. It is a significant amount of space for an alpine image:

$ docker run --rm -it library/ruby:3.3.6-alpine du -hs /usr/include/linux
6.7M	/usr/include/linux
@tianon
Copy link
Member

tianon commented Jan 7, 2025

We traced the history back through #349 to #60 for why these -dev packages are even installed persistently to begin with, because that's unusual for our Alpine-based images. The best we can find is #33, which is that the "slim" images included the dev packages too, and that's also unusual.

I'm sure there was a good reason, but that was done way back when we were still figuring things out, so I'm almost inclined to remove them from the persistent dependencies entirely and see how it goes. 🤔

That being said, such a change is a breaking change, and that causes me some pause. I'd definitely like to make the change, though, because they're not appropriate to include in the Alpine (or even Slim) images.

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 a pull request may close this issue.

2 participants