How to use nerdctl if you are familiar with Docker CLI

🚧 Work in progress... This is a draft version of the lesson about nerdctl. Please, consider supporting the development of this course on Patreon to help me finish this lesson faster.

nerdctl is a relatively new command-line client for containerd. Unlike ctr, nerdctl aims to be user-friendly and Docker-compatible. To some extent, nerdctl + containerd can seamlessly replace docker + dockerd. However, this does not seem to be the main goal of the project.

From the basic usage standpoint, comparing to ctr, nerdctl supports:

  • Image building with nerdctl build (BuildKit required)
  • Container networking management
  • Docker Compose with nerdctl compose up

And the coolest part about it is that nerdctl tries to provide the identical to docker (and podman) command-line UX. So, if you are familiar with docker (or podman) CLI, you are already familiar with nerdctl.

nerdctl run -d -p 8080:80 --name nginx3 nginx