Perform the following steps:
- Run the following command inside the directory where we created the Dockerfile to build the image:
$ docker image build .
In the preceding setup, we did not specify any repository and tag name while building the image. It is always recommended that you build the image with a repository name for easy reference in the future.
- Now, let's proceed to create our own repository name using the -t option of the docker image build command, as follows:
$ docker image build -t sample .
If you compare ...