>_ IzzyLab

Hands-on task

This task is step 1 of the course “Docker from scratch”

First container

easy~5 min

Docker is already installed on the server, and the images you need are downloaded in advance. Run your first container: from the alpine:3.21 image, run the command cat /etc/alpine-release inside it — it prints the Alpine Linux version in the container.

The container exits by itself as soon as the command finishes — that's expected. Don't remove the container — it shows the run happened.

What you'll practise:
  • docker run
  • image and container

Topic breakdown

An image is a template: the files of a small system plus a default command. A container is a process started from an image with its own copy of those files. You can run as many containers from one image as you like.

docker run busybox:1.36 echo hello

Docker creates a container from the busybox:1.36 image, runs echo hello in it, prints the output — and the container stops: it lives as long as its command runs.

An image name is name:tag; the tag usually means a version, and without a tag Docker uses latest. If the image isn't on the server, docker run first downloads it from a registry — Docker Hub by default — and prints Unable to find image … locally, then Pulling from …. This lab has no internet access, so the alpine, busybox, nginx and izzylab/minihttp images are loaded in advance.

What's checked

  1. There's a container from the alpine:3.21 image
  2. The container printed the Alpine version

What it looks like