apache_php Dockerfile

I have done docker image of apache several times before, and the image was successful. However, apache does not run automatically at runtime. You have to log in to the container and start apache manually. I did it again today, and finally came out and recorded it for backup.

# Dockerfile

FROM tianon/apache2:latest

MAINTAINER [email protected] September 29, 2016

RUN echo "Asia/Shanghai" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata

#ADD run.sh /root/run.sh
#RUN chmod 755 /root/*.sh

COPY index.php /var/www/html

ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR / var / log / apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
ENV APACHE_RUN_DIR / var / run / apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_SERVERADMIN admin@localhost
ENV APACHE_SERVERNAME localhost
ENV APACHE_SERVERALIAS docker.localhost
ENV APACHE_DOCUMENTROOT /var/www

EXPOSE 80
WORKDIR / var / www / html

ENTRYPOINT apache2 -D FOREGROUND


Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327042500&siteId=291194637