Skip to main content

Posts

Showing posts from 2019

Learn to build docker image

Hi guys, I will try to show you here how u can learn to build a image using docker and run that image later as a container. I will build a image to run a webserver with static content in it and for this I will use nginx image which is available in docker hub . Hoping that you have already installed docker package in your machine. Below are the steps to build a simple docker image: 1. Create a Docker file and add below contents "From nginx" indicates that docker should use nginx image. If nginx image is available in local repository then it will use that else it will download from docker hub "COPY index.html /usr/share/nginx/html" says that copy the index.html which is available in current directory to directory /usr/share/nginx/html 2. Create index.html  which is required as per above steps in same directory 3. Build the image mynginx is the image name given and v1 is the tag for that image Please note that at the end of command there