Images: pulling and listing

What an image is and how to get one.

A Docker practice simulator runs inside your browser tab. It behaves like the real commands for what the lessons teach, and it is labelled as a simulation.

An image is a packaged program

An image is a package that holds a program and everything it needs to run: its files, libraries and settings. A container is one running copy of an image.

Images live in a registry. docker pull downloads one to your computer. Load the example and press Run.

This terminal is a simulation. It keeps track of images and containers and answers the way Docker does, but nothing is really downloaded.

Example
docker pull nginx

Tags pick a version

An image name can end with a colon and a tag, such as redis:7. The tag picks a version.

If you leave the tag out, Docker uses the tag latest. In real projects, name the version you want, so that everyone runs the same one.

docker images lists the images on your computer. You can put one command on each line.

Example
docker pull redis:7
docker images

Your turn: two images

Write one command per line, press Run to try it, then press Check.

Practice task

Pull the alpine image and the redis image.

Your answer is run and checked in the lesson. Try it now.

Your turn: a chosen version

Ask for a version by its tag.

Practice task

Pull the nginx image with the tag 1.27.

Your answer is run and checked in the lesson. Try it now.