#Create a directory
mkdir volume
#Enter the directory
cd volume
#At first run nginx server
sudo docker run --name hstore -d -p 1000:80 nginx
#Check docker container
sudo docker ps
#Run nginx on Browser
localhost:1000
# Create a index.html page into volume directory
<html>
<head>
<title>Docker</title>
</head>
<body>
<h1>Welcome to docker volume</h1>
</body>
</html>
sudo docker run --name hstore -v "/home/sumon/volume":/usr/share/nginx/html -d -p 1000:80 nginx
After execute the command check the cd /usr/share/nginx/html directory here will show the index.html page
Now create a product.html page into html directory . Then check the volume directory and here will show the product.html page
# Change the local repository name to the same as Dockerhub repository name
docker tag localr epo:tag dockerhub repo:tag
# Check the change repo name
docker images
# Login the docker hub
docker login
# Push the image to docker hub
docker push new repo name