Repository navigation
Expand file tree
/
Copy pathstatic-builder.Dockerfile
More file actions
45 lines (37 loc) 路 1.66 KB
/
Copy pathstatic-builder.Dockerfile
File metadata and controls
45 lines (37 loc) 路 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# syntax=docker/dockerfile:1
#checkov:skip=CKV_DOCKER_2
#checkov:skip=CKV_DOCKER_3
#checkov:skip=CKV_DOCKER_7
# Toolchain image for the static builds, shared by the musl and the glibc flavor.
# It ships glibc 2.28 (RHEL 8) and GCC 16.
#
# The build happens when the container *runs*, not while the image is built, so
# that the static-php-cli logs can be copied out of the container when it fails.
#
# docker run --rm -v "$PWD/output:/output" -e OUTPUT_DIR=/output -e SPC_LOGS_DIR=/output/log \
# dunglas/frankenphp:static-builder-gnu
#
# The musl flavor links with zig, which opens a lot of file descriptors when many
# extensions are built statically; give it `--ulimit nofile=8192:8192`.
#
# Every variable build-static.sh understands (PHP_VERSION, PHP_EXTENSIONS,
# XCADDY_ARGS, EMBED, MIMALLOC, ...) is passed with `docker run -e`; there is no
# need to rebuild the image to change them.
FROM ghcr.io/static-php/packages-builder-rhel-8:latest
LABEL org.opencontainers.image.title=FrankenPHP
LABEL org.opencontainers.image.description="The modern PHP app server"
LABEL org.opencontainers.image.url=https://frankenphp.dev
LABEL org.opencontainers.image.source=https://github.com/php/frankenphp
LABEL org.opencontainers.image.licenses=MIT
LABEL org.opencontainers.image.vendor="K茅vin Dunglas"
ARG FRANKENPHP_VERSION=''
ENV FRANKENPHP_VERSION=${FRANKENPHP_VERSION}
ARG LIBC=gnu
ENV LIBC=${LIBC}
# static-php-cli downloads the Go toolchain it needs, don't let go.mod fetch another one.
ENV GOTOOLCHAIN=local
# we build with OPENSSLDIR=/etc/ssl which doesn't exist in RHEL
RUN ln -s ../pki/tls/cert.pem /etc/ssl/cert.pem
WORKDIR /go/src/app
COPY --link . ./
CMD ["./build-static.sh"]