This page is a brief tutorial on how to host a website using Docker.
This is as simple as heading to the Docker website and hitting the "Download" button. To verify your installation is working, run the command "docker run hello-world" in your shell once Docker is running.
With Docker up and running, use the command "docker pull ubuntu" to run an Ubuntu image.
Run the newly-installed Ubuntu image using "docker run -it ubuntu:latest /bin/bash" to start a new container and log into it.
Install apache and vim using the commands "apt-get install apache2" and "apt-get install vim" respectively.
Commit changes to the container using "docker commit (container ID) ubuntu-my_apache2". This creates a new Docker image using the container you just created.
Use the command “docker run -it -p 127.0.0.1:80:80 -v H:\Docker_tutorial\local_dir: /var/www/html ubuntu-my_apache2 /bin/bash” to bind the container to a directory on your computer.
Either create a new HTML file or place pre-made HTML files into the linked directory. Use the command “/etc/init.d/apache2 restart” to start the apache service. Access the listed IP using your web browser and you should now have your website successfully hosted.