@@ -4,11 +4,6 @@ FROM ${FRANKENPHP_DOCKER_IMAGE}
44
55SHELL ["/bin/bash" , "-eu" , "-o" , "pipefail" , "-c" ]
66
7- # Install PHP extensions provided by user
8- # Always install xdebug, but disable it by default
9- ARG FRANKENPHP_PHP_EXTENSIONS=""
10- RUN install-php-extensions xdebug ${FRANKENPHP_PHP_EXTENSIONS} && rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
11-
127# Add a new user and give it ownership of frankenphp related files
138ARG username
149ARG uid
@@ -20,6 +15,22 @@ RUN <<EOF
2015 chown -R ${username}:${username} /data/caddy /config/caddy
2116EOF
2217
18+ RUN (apt-get update || true) && apt-get install -y --no-install-recommends sudo \
19+ && rm -rf /var/lib/apt/lists/*
20+
21+ # CAROOT for `mkcert` to use, has the CA config
22+ ENV CAROOT=/mnt/ddev-global-cache/mkcert
23+ # Give the `${username}` user full `sudo` privileges
24+ RUN mkdir -p /etc/sudoers.d && echo "${username} ALL=(ALL) NOPASSWD: ALL" >> "/etc/sudoers.d/${username}" && chmod 0440 "/etc/sudoers.d/${username}"
25+ # Install the correct architecture binary of `mkcert`
26+ ARG TARGETARCH
27+ RUN mkdir -p /usr/local/bin && curl --fail -JL -s -o /usr/local/bin/mkcert "https://dl.filippo.io/mkcert/latest?for=linux/${TARGETARCH}" && chmod +x /usr/local/bin/mkcert
28+
29+ # Install PHP extensions provided by user
30+ # Always install xdebug, but disable it by default
31+ ARG FRANKENPHP_PHP_EXTENSIONS=""
32+ RUN install-php-extensions xdebug ${FRANKENPHP_PHP_EXTENSIONS} && rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
33+
2334# Enable xdebug on demand with custom DDEV config
2435ARG FRANKENPHP_XDEBUG=false
2536RUN <<EOF
0 commit comments