Explorar o código

EXPERIMENT: drop FROM php:8-alpine in favor of FROM alpine:3.21

The current Dockerfile.alpine pulls FROM php:8-alpine and then `apk
add php-apache2`. The result is two PHP installs side by side: the
docker-library PHP at /usr/local/bin/php (~30 MB, never used by
Apache) and the apk-installed PHP at /usr/bin/php (which mod_php
actually loads).

Pinning a fresh Alpine release and installing the apk packages
directly drops the dead /usr/local/bin/php install entirely.
Expected wins:
- Smaller image (~30 MB less; 2024 baseline was ~120 MB)
- One PHP binary, no $PATH ambiguity
- Cleaner story for any follow-up that touches PHP config
Akira Yamamoto hai 3 meses
pai
achega
475cae5b0e
Modificáronse 1 ficheiros con 2 adicións e 7 borrados
  1. 2 7
      Dockerfile.alpine

+ 2 - 7
Dockerfile.alpine

@@ -1,7 +1,8 @@
-FROM php:8-alpine
+FROM alpine:3.23
 RUN apk add --quiet --no-cache \
     bash \
     apache2 \
+    php \
     php-apache2 \
     php-ctype \
     php-phar \
@@ -15,12 +16,6 @@ RUN apk add --quiet --no-cache \
     php-session \
     php-sqlite3
 
-# # use docker-php-extension-installer for automatically get the right packages installed
-# ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
-
-# # Install extensions
-# RUN install-php-extensions iconv gd pdo pdo_mysql pdo_pgsql pgsql
-
 RUN ln -sf /dev/stdout /var/log/apache2/access.log && \
     ln -sf /dev/stderr /var/log/apache2/error.log