dnp-harbor/services/php53/Dockerfile

32 lines
1.2 KiB
Docker
Raw Normal View History

2024-10-25 18:15:29 +08:00
ARG PHP_VERSION
FROM ${PHP_VERSION}
ARG TZ
ARG PHP_EXTENSIONS
ARG CONTAINER_PACKAGE_URL
2025-01-07 09:14:42 +08:00
# 替换源列表,更新软件包索引
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
2024-10-25 18:15:29 +08:00
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 \
2025-01-07 09:14:42 +08:00
&& sh install.sh
2024-10-25 18:15:29 +08:00
# 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