Below are the Prerequisites to configure docker on Linux
Virtual machine.
1.
Configure Linux VM. Checkout this link.
2.
Create image and publish it to docker hub. Checkout
this link. Below steps will help to configure docker, pull docker image
from docker hub and deploy it in Container.
1.
To configure the Linux machine with Apache,
click on the link.
2.
To install docker on the Linux Machine. Run the
below command
sudo
curl -fsSL get.docker.com | /bin/bash
3.
Add
user to docker, Run the below command to add a user for docker.
sudo usermod -aG docker Ubuntu
4.
Start
the Docker Service
sudo service docker restart
5.
Pull
Image from docker hub. To login into docker, use the below command.
docker login
Provide
docker hub credentials to enable download the image from docker
6.
Pull
image from docker hub (user should do the login before this)
docker pull <username/imagename>
7.
Check
whether image is present or not. Run the below command to verify the docker
images is downloaded or not.
docker images
8.
deploy
docker image in Container by running the below command
docker run -d -p 5060:80 --name <containername>
<username/imagename:tag>
Verify
the deployment done successfully by browsing through the “5060” port. For e.g. http://URL:PORT/
|