Images and the Dockerfile
Part of the Docker course
So far you have only opened bags that someone else sealed: hello-world, ubuntu, alpine. That is fine for exploring, but it does not solve the problem from the very first lesson, getting your own program to run the same way on every machine. For that you need to seal your own bag.
Think back to the sealed grocery bag from the first lesson. Someone had to pack that bag: decide what goes in, in what order, and what note to tape to the outside. A Dockerfile is you writing down exactly that packing list, as plain text, one instruction per line. Docker reads it top to bottom and packs the bag accordingly.
Want to learn Docker Images and the Dockerfile in a real environment?
Click below, get a fresh Linux box with Docker ready to go, and work through Images and the Dockerfile hands-on with an AI tutor that knows your code.
Start this lessonImages and the DockerfileWhat you'll learn
- FROM
- RUN
- CMD
- Docker build
- Docker images
- Docker rmi
Read this lesson in your language
All lessons in this course
13 lessons- 1What Is Docker20 min
- 2Your First Container25 min
- 3Images and the Dockerfile30 min
- 4Building Custom Images35 min
- 5Container Networking30 min
- 6Volumes and Persistence30 min
- 7Docker Compose35 min
- 8Multi-Stage Builds35 min
- 9Environment Variables and Secrets25 min
- 10Healthchecks and Restart Policies25 min
- 11Image Optimization and Security30 min
- 12Registries and Publishing25 min
- 13Capstone: Shipping a Stack50 min
