This article represents 3 different ways using which one could create a Docker image. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos.
In the command below, hub-user is the name of your user account on http://hub.docker.com, repo-name is the repository name that you create and tag is the name you assign to specific image (e.g., dev, testing etc). Following are the different ways:
- docker build -t <hub-user>/<repo-name>[:<tag>] -t <dockerfile> .
- docker tag <existing-image> <hub-user>/<repo-name>[:<tag>]. The “existing-image” uis the name of image which already exists in your local repository.
- docker commit <exiting-container> <hub-user>/<repo-name>[:<tag>]. This command is handy when you have built a container as you go and later wanted to build an image based on this container.
Latest posts by Ajitesh Kumar (see all)
- Mean Squared Error or R-Squared – Which one to use? - September 30, 2020
- Linear Regression Explained with Python Examples - September 30, 2020
- Correlation Concepts, Matrix & Heatmap using Seaborn - September 29, 2020