docker-library / haproxy

Docker Official Image packaging for HAProxy
http://www.haproxy.org/
GNU General Public License v2.0
347 stars 158 forks source link

Images contain `*-dev` packages that are used to build HAProxy but which are useless at runtime #225

Closed L3n41c closed 3 months ago

L3n41c commented 3 months ago

The haproxy docker images are containing some *-dev packages:

$ docker run --rm -it --user 0 --entrypoint /usr/bin/bash haproxy:2.4.25
root@f6106d13cb42:/# apt search -- -dev
Sorting... Done
Full Text Search... Done
dpkg/now 1.21.22 amd64 [installed,local]
  Debian package management system

libc-dev-bin/now 2.36-9+deb12u4 amd64 [installed,local]
  GNU C Library: Development binaries

libc6-dev/now 2.36-9+deb12u4 amd64 [installed,local]
  GNU C Library: Development Libraries and Header Files

libcrypt-dev/now 1:4.4.33-2 amd64 [installed,local]
  libcrypt development files

libnsl-dev/now 1.3.0-2 amd64 [installed,local]
  libnsl development files

libtirpc-dev/now 1.3.3+ds-1 amd64 [installed,local]
  transport-independent RPC library - development files

linux-libc-dev/now 6.1.76-1 amd64 [installed,local]
  Linux support headers for userspace development

Whereas those packages are needed to build haproxy, they contain only header files and static libraries which are useless at runtime. Hence, they shouldn’t be shipped in the final image.