Follow these steps to create a Web Server using Docker
Make a directory in terminal using these commands:
mkdir /test
cd /test
Now create a file `Dockerfile` (File name is hard coded do not change the file name)
touch /test/Dockerfile
Create a sample web page with name index.html
vi /test/index.html
Edit the file using following instructions
vi Dockerfile
FROM centos:latest
MAINTAINER NewstarCorporation
RUN yum -y install httpd
COPY index.html /var/www/html/
CMD [“/usr/sbin/httpd”, “-D”, “FOREGROUND”]
EXPOSE 80
Build the image using docker build. Test is the directory where Dockerfile is present and –t option is to tag or name the image. After building Run the docker image.