← All videos
Watch & learn
Learn how to create a Docker image in 162 seconds
March 14, 20243 min watchEnglish
Description
Learn all the commands needed to create your first Docker Image in 162 seconds.
Learning outcomes
- What is a Docker Image?
- How do I create my first Docker Image?
- What commands do I need?
- How do the commands work together?
- How do Tags work?
- How do I keep my Registry clear?
Commands You Will Learn
docker build . – build an image out of a Dockerfile located in the current Docker build context . and stores it in the local registry
--file <path-to-dockerfile> – add this flag to the docker build command when your Dockerfile is not located in the current Docker build context or named differently than Dockerfile (e.g., Dockerfile.server)
--tag <user-name>/<repository-name>:<version> – add this flag to the docker build command when you want to give your image a unique name (e.g., examplename/examplerepository:0.1.0)
docker image ls – list all images in your local registry
docker image rm <image-name/image-id> – delete an image from your local registry

