Creating a Docker image from Dockerfile
Our next step is to create a sample image file. We can build a Docker image using a Dockerfile. It provides step-by-step instructions to building images.
Let's try with a simple CentOS image:
The Dockerfile contains the following two lines:
FROM centos MAINTAINER mitesh <mitesh.soxxxxxx@xxxxxxxx.com>
Go to the same directory in the terminal and use
docker build .
to build an image:[root@localhost Desktop]# docker build . Sending build context to Docker daemon 681.6 MB Sending build context to Docker daemon Step 0 : FROM centos ---> 2a332da70fd1 Step 1 : MAINTAINER mitesh < mitesh.soxxxxxx@xxxxxxxx.com > ---> Running in 305e8da05500 ---> b636e26a333a Removing intermediate container 305e8da05500 Successfully built b636e26a333a You...