Skip to content

Most debian images has gcc #1528

@firecow

Description

@firecow

dive php:8.3.9-zts-bookworm shows that gcc is added to a layer, causing all debian images to use 125mb extra.

image

Something like this seems to get php building and reduces the image size significantly

Index: Dockerfile-linux.template
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template
--- a/Dockerfile-linux.template	(revision 67bf0a36045d27dfe4f83042c823bb2e0785d15d)
+++ b/Dockerfile-linux.template	(date 1720461001944)
@@ -63,7 +63,6 @@
 RUN set -eux; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends \
-		$PHPIZE_DEPS \
 		ca-certificates \
 		curl \
 		xz-utils \
@@ -262,6 +261,7 @@
 		else
 			# debian packages
 			if env.variant == "apache" then "apache2-dev" else empty end,
+			"$PHPIZE_DEPS",
 			"libargon2-dev",
 			"libcurl4-openssl-dev",
 			"libreadline-dev",

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