dnp-harbor/services/php53/Dockerfile
2025-01-07 09:14:42 +08:00

32 lines
1.2 KiB
Docker

ARG PHP_VERSION
FROM ${PHP_VERSION}
ARG TZ
ARG PHP_EXTENSIONS
ARG CONTAINER_PACKAGE_URL
# 替换源列表,更新软件包索引
RUN echo "deb http://archive.debian.org/debian/ stretch main contrib non-free" > /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian/ stretch main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian-security/ stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian-security/ stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list && \
apt-get update
RUN apt-get install -y --allow-unauthenticated --no-install-recommends libyaml-dev
COPY ./docker-php-ext-enable /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-php-ext-enable
COPY ./extensions /tmp/extensions
WORKDIR /tmp/extensions
RUN chmod +x install.sh \
&& sh install.sh
# php image's www-data user uid & gid are 82, change them to 1000 (primary user)
RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
# Use www-data to run the first process
USER "www-data"
WORKDIR /www