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)
- When to use Deep Learning vs Machine Learning Models? - January 17, 2021
- Most Common Types of Machine Learning Problems - January 14, 2021
- Historical Dates & Timeline for Deep Learning - January 10, 2021