php-build (latest)

Published 2026-06-16 11:47:52 +02:00 by ludwig in ludwig/container-php

Installation

docker pull code.netztechniker.at/ludwig/php-build:latest
sha256:951f9034c665a6f77084114602de072440824e7c4fc8902a285015cfc9e05e6e

About this package

Base image to build PHP with extensions. Includes unpacked PHP sources, PIE, PHP helper binaries and an extension build script.

Image layers

ADD alpine-minirootfs-3.24.1-x86_64.tar.gz / # buildkit
CMD ["/bin/sh"]
/bin/sh
LABEL org.opencontainers.image.authors="Ludwig Rafelsberger <info@netztechniker.at>"
LABEL org.opencontainers.image.source="https://code.netztechniker.at/ludwig/container-php"
LABEL org.opencontainers.image.vendor="netztechniker.at"
LABEL org.opencontainers.image.title="php build base"
LABEL org.opencontainers.image.description="Base image to build PHP with extensions. Includes unpacked PHP sources, PIE, PHP helper binaries and an extension build script."
ADD file:2c839faea38099d9a83d60c8fe6c1b44e1ac02a41c29738a485640c40555390c in /usr/local/bin/build-shared-extension
ARG PHP_VERSION
COPY dir:49c03a6d922794c94e899352d4441221a1c3d3904764bdd325701aa33984ca21 in /php-${PHP_VERSION}
WORKDIR /php-${PHP_VERSION}
LABEL org.opencontainers.image.version="${PHP_VERSION}"
|1 PHP_VERSION=8.5.7 /bin/sh -c --mount=type=cache,sharing=locked,id=package-manager-alpine-3.24,target=/var/cache/apk <<EOF ln -s /var/cache/apk /etc/apk/cache build_deps="autoconf libxml2-dev build-base" # shellcheck disable=SC2086 # need to expand string into individual arguments apk add --update $build_deps || exit 1 # note about "--with-zlib": # there is an ongoing bug in the php build system producing a semi-broken php # when --with-zlib is not specified: # https://gitlab.alpinelinux.org/alpine/aports/-/issues/8299 # https://github.com/php/php-src/pull/4681 PHP_UNAME="$(uname -o -r)" \ PHP_BUILD_SYSTEM='Linux Container' \ PHP_BUILD_PROVIDER='netztechniker.at' \ PHP_BUILD_COMPILER='gcc' \ PHP_BUILD_ARCH='x86_64-alpine-linux-musl' \ CFLAGS='-O2 -pipe -march=x86-64 -mtune=generic -fomit-frame-pointer' \ CXXFLAGS='-O2 -pipe -march=x86-64 -mtune=generic -fomit-frame-pointer' \ EXTENSION_DIR=/usr/lib/php/modules \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --with-config-file-path=/etc/php \ --with-config-file-scan-dir=/etc/php/conf.d \ --localstatedir=/var \ --build=x86_64-alpine-linux-musl \ --host=x86_64-alpine-linux-musl \ --with-layout=GNU \ --with-pic \ --disable-cgi \ --disable-phpdbg \ --disable-short-tags \ --disable-rpath \ --disable-all \ --with-zlib \ --with-libxml \ --with-pear \ --enable-xml \ || exit 1 make -j"$(nproc)" || exit 1 strip --strip-unneeded \ sapi/cli/php \ || exit 1 make install || exit 1 make distclean || exit 1 # shellcheck disable=SC2086 # need to expand string into individual arguments apk del $build_deps || exit 1 unlink /etc/apk/cache
ARG PHP_VERSION PIE_VERSION
ADD file:28826ce2122f6ee8d9780354d6803390ecebe74b043b3f3522751c7d359eefc2 in /usr/bin/pie org.opencontainers.image.revision=39a35e2d2fde4c3f5ae787ffc362677ac4380291,org.opencontainers.image.source=https://code.netztechniker.at/ludwig/container-php,org.opencontainers.image.url=https://code.netztechniker.at/ludwig/-/packages/container/php-build,org.opencontainers.image.version=8.5.7

Labels

Key Value
io.buildah.version 1.43.2
org.opencontainers.image.authors Ludwig Rafelsberger <info@netztechniker.at>
org.opencontainers.image.description Base image to build PHP with extensions. Includes unpacked PHP sources, PIE, PHP helper binaries and an extension build script.
org.opencontainers.image.source https://code.netztechniker.at/ludwig/container-php
org.opencontainers.image.title php build base
org.opencontainers.image.vendor netztechniker.at
org.opencontainers.image.version 8.5.7
Details
Container
2026-06-16 11:47:52 +02:00
13
OCI / Docker
linux/amd64
Ludwig Rafelsberger <info@netztechniker.at>
37 MiB
Versions (10) View all
latest 2026-06-16
8 2026-06-16
8.5 2026-06-16
8.5.7 2026-06-16
8.4 2026-06-16