[root@dyw219 newimg]# echo 'myweb test' > index.html [root@dyw219 newimg]# cat index.html myweb test
[root@dyw219 newimg]# vim Dockerfile [root@dyw219 newimg]# cat Dockerfile # index.html comment FROM centos/httpd:latest COPY index.html /var/www/html/ RUN chmod 644 /var/www/html/index.html
[root@dyw219 newimg]# docker build -t centos/httpd:index . Sending build context to Docker daemon 5.12 kB Sending build context to Docker daemon Step 0 : FROM centos/httpd:latest ---> b4650389df73 Step 1 : COPY index.html /var/www/html/ ---> b98ddcfe17b5 Removing intermediate container bd818bc1ef9c Step 2 : RUN chmod 644 /var/www/html/index.html ---> Running in 816153a21ab4 ---> eec966fc2c86 Removing intermediate container 816153a21ab4 Successfully built eec966fc2c86