Skip to content
Lab 1 of 3

Run & Configure the Docker Daemon

Your machine has the Docker Engine installed but the daemon has never been started. Configure logging and storage in daemon.json, bring the daemon up by hand, import a base image on an air-gapped host, and run your first managed container.
  • Intermediate
  • 45 min
  • Docker
  • Containers
  • Daemon
  • DevOps

Overview

Most engineers only ever meet Docker after someone else has installed and started it. This lab hands you the engine in pieces: the client binary is present, but dockerd — the daemon that actually builds images and runs containers — has never been started, and nothing is configured.

You'll administer it from the ground up. Write /etc/docker/daemon.json to control logging and storage before the first boot, start the daemon by hand (no systemd here to hide the details), and deal with a real constraint: this 'machine' is itself a container, so you'll choose the fuse-overlayfs storage driver the way nested and rootless setups do. Then you'll feed it a base image on an air-gapped host and run your first managed container with a restart policy. When you're done, nothing about the Docker daemon will feel like magic.

What you will learn

  • Tell the Docker client apart from the dockerd daemon and diagnose a 'cannot connect' error
  • Configure log rotation and a storage driver in /etc/docker/daemon.json
  • Start and verify the daemon by hand, reading its boot log to debug config errors
  • Import a base image from a raw root filesystem with docker import (no registry)
  • Run a detached, named container with a daemon-enforced restart policy

Before you start

  • Solid Linux shell skills and sudo
  • A rough idea of what a container is — you'll build up the rest
  • Familiarity with JSON syntax

Tasks

  1. 01Confirm the engine is installed but down
  2. 02Configure log rotation before first boot
  3. 03Pick a storage driver that works in nested environments
  4. 04Start the daemon and verify it took your config
  5. 05Import a base image on an air-gapped host
  6. 06Run a managed container with a restart policy

Next in this course