构建 php:5.6-apache镜像

dockerfike 内容,中间换源

FROM php:5.6-apache


RUN echo "deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse \n\
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse \n\
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse \n\
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse \n\
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse \n\
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse \n\
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse \n\
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse \n\
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse" > /etc/apt/sources.list


RUN apt-get update && apt-get install gnupg -y --force-yes \
&& touch /etc/apt/apt.conf \
&& echo 'APT { Get { AllowUnauthenticated "1" } }'> /etc/apt/apt.conf \

&& DEBIAN_FRONTEND=noninteractive apt-get -y install vim -y \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install cron -y \
--no-install-recommends \
&& rm -r /var/lib/apt/lists/*


run apt-get update && apt-get install -y zlib1g-dev && apt-get install -y libzip-dev





RUN docker-php-ext-install mysql \
&& docker-php-ext-install mysqli \
&& docker-php-ext-install zip

run apt install -y libwebp-dev libjpeg-dev libpng-dev libfreetype6-dev

run docker-php-source extract

run docker-php-ext-configure gd \
--with-jpeg=/usr/include \
--with-freetype=/usr/include/

run docker-php-ext-install gd
run docker-php-ext-enable gd




RUN rm -f /usr/local/etc/php/php.ini
COPY php.ini /usr/local/etc/php/

RUN { \
echo '<VirtualHost *:80>';\
echo 'ServerAdmin webmaster@localhost';\
echo 'DocumentRoot /saic/html';\
echo 'ErrorLog /etc/apache2/error.log';\
echo 'CustomLog /etc/apache2/access.log combined';\

echo '</VirtualHost>';\
} > /etc/apache2/sites-available/000-default.conf

RUN chmod 777 /etc/apache2/apache2.conf \
&& sed -i -e '/<Directory \/>/i\<Directory \/test\/html>\n \ Options FollowSymLinks\n \ AllowOverride None\n \ Require all granted\n \<\/Directory>' /etc/apache2/apache2.conf


RUN rm -f /etc/apache2/mods-enabled/mime.conf
COPY mime.conf /etc/apache2/mods-enabled/
ENV HTTPS off
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
# && echo "export FORCE_HTTPS=\${HTTPS}" >> /etc/apache2/envvars




COPY entrypoint.sh /var/
ENTRYPOINT ["/bin/bash","/var/entrypoint.sh"]




posted @ 2023-12-20 10:32  沉浮是非  阅读(84)  评论(0)    收藏  举报
Title