Skip to content

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

@stevecrozz

Description

@stevecrozz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions