Appendix B. Docker Basic Installation and Use

This book contains a number of examples that run inside Docker containers for standardization across different operating systems.

This section will help you install Docker and familiarize yourself with some of the most commonly used Docker commands, so that you can run the book’s example containers.

Installing Docker

Before we begin, you should install the Docker container system on your computer. Docker is an open system that is distributed for free as a Community Edition for many different operating systems including Windows, macOS, and Linux. The Windows and Macintosh versions are called Docker Desktop and consist of a GUI desktop application and command-line tools. The Linux version is called Docker Engine and is comprised of a server daemon and command-line tools. We will be using the command-line tools, which are identical across all platforms.

Go ahead and install Docker for your operating system by following the instructions to “Get Docker” from the Docker website.

Select your operating system from the list and follow the installation instructions.

Tip

If you install on Linux, follow the post-installation instructions to ensure you can run Docker as a regular user instead of user root. Otherwise, you will need to prefix all docker commands with sudo, running them as root like: sudo docker.

Once you have Docker installed, you can test your installation by running the demo container hello-world like this:

$ docker run hello-world ...

Get Mastering the Lightning Network now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.