A web server is server software, or hardware dedicated to running this software, that can satisfy client requests on the World Wide Web
Key-step: After the installation, you can run “docker run hello-world” to test your installation. Below is a screenshot when you have ran this command successfully on Mac OS.
Key-step 1: After logging into Docker, you can run “docker pull ubuntu” in your command line window.
Key-step 2: Use “docker images” to check existing Docker images on your computer.
Key-step 1: Run the Ubuntu image to start a Docker container, then log into this Ubuntu container:
Command:
docker run -it ubuntu:latest /bin/bash
The container ID is located to the right of the current user in linux (i.e Root@ “800bbded462a”)
Key-step 2: Install applications in this Ubuntu container.
Update system using:
“apt-get update -y”
Install apache2 using:
“apt-get install apache2 -y”
Install vim text editor using:
“apt-get install vim -y"
Key-step 3:Exit Ubuntu container using the command
exit
Key-step 4: Commit container to create a new Docker image
1) Check the container using:
“docker ps -a”
i.e make sure to copy the id of the given ubuntu container
Using command:
“docker run -it -p 127.0.0.1:80:80 -v /Users/lighthisels/Documents:/var/www/html ubuntu-my_apache2 /bin/bash”
Key step 1: check the present working directory using
“pwd”
then go the html directory using:
“cd /var/www/html”
Key step 2: create an “index.html” file using:
“vi index.html”
After finishing your “index.html” file, press the “ESC” key of your computer then type “:wq” to write the file and then quit vi.
Meanwhile, you can find your “index.html” in your bind directory on your computer.
Key step 1: Start apache service using “/etc/init.d/apache2 restart” in your Docker container.