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)
- Agentic Reasoning Design Patterns in AI: Examples - October 18, 2024
- LLMs for Adaptive Learning & Personalized Education - October 8, 2024
- Sparse Mixture of Experts (MoE) Models: Examples - October 6, 2024
I found it very helpful. However the differences are not too understandable for me