Docker

IntermediateLesson 3 of 1330 min, hands-on

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. ...

What you'll learn

  • FROM
  • RUN
  • CMD
  • docker build
  • docker images
  • docker rmi

Work through Images and the Dockerfile

Sign in free and open the Docker course. Work through the lesson, and ask the AI tutor when you get stuck.