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)
- What are AI Agents? How do they work? - January 7, 2025
- Agentic AI Design Patterns Examples - January 6, 2025
- List of Agentic AI Resources, Papers, Courses - January 5, 2025
I found it very helpful. However the differences are not too understandable for me