| FROM | Source image | FROM name/web:ver1.0 | 
| MAINTAINER | ||
| ENV | Environment variable | ENV KEY=VALUE | 
| RUN | Execute the specified command | RUN yum -y install httpd | 
| ADD | Add file to image | ADD index.html /var/www/html/index.htm | 
| EXPOSE | Specify port number | EXPOSE 80 | 
| CMD | Command executed when container starts | CMD [“service”,“httpd”,“start”] | 
| ENTRYPOINT | ENTRYPOINT [“/usr/sbin/httpd”, “-DFOREGROUND”] | |
| WORKDIR | Specify current directory | WORKDIR /var/www/html | 
| VOLUME | Volume specification | VOLUME /var/log/httpd | 
# mkdir test # cd test # vi Dockerfile
FROM centos
RUN yum update -y \
    && yum install httpd -y \
    && echo "hello world from dockerfile" > /var/www/html/index2.html \
    && yum clean all
ADD ./httpd/www/index.html /var/www/html/
EXPOSE 80
ENTRYPOINT ["/usr/sbin/httpd", "-DFOREGROUND"]
# docker build . -t mycentos_with_httpd_from_dockerfile # docker images
# docker run -d --rm -p 8080:80 mycentos_with_httpd_from_dockerfile
http://x.x.x.x/index.html
http://x.x.x.x/index2.html
FROM php:7.0-apache COPY ./etc_apache2_conf-enabled_docker-php.conf /etc/apache2/conf-enabled/docker-php.conf COPY ./var_www_html_index.php /var/www/html/
# docker build --tag php70-apache ./ # docker run -d --name php70-apache -p 8080:80 php70-apache # docker container exec -ti php70-apache bash # docker ps --filter name=php70-apache # docker logs [ContainerID] # docker stop [ContainerID] # docker rm [ContainerID] # docker images php70-apache # docker rmi [ImageID]