Appendix B. Installing Docker

Docker is a tool for running applications within containers on a particular machine. It is used throughout this book for running various databases, third-party services, and even applications that you write. Docker maintains an Install Docker Engine page, but the instructions for macOS and Linux have been repeated here for your reference.

macOS: Install Docker Desktop for Mac

The primary way to install Docker on macOS is by installing Docker Desktop for Mac. This will provide you with not only the Docker daemon and CLI tools, but it will also provide you with a GUI tool that runs in your menu bar. Visit the Docker Desktop for Mac page and download the stable disk image, then go through the usual macOS installation process.

Linux: Convenient Install Script

If you’re using an Ubuntu-based operating sytem, you can install Docker by adding the Docker repository to your system and installing with your package manager. This will allow Docker to remain updated by doing normal package upgrade operations.

Docker provides a convenient script that will do several things. First, it’ll configure your Linux distribution’s package manager to use the Docker repository. The script supports several distros like Ubuntu and CentOS. It’ll also install the necessary packages from the Docker repository to your local machine. When you perform package upgrades in the future, your machine will also update Docker:

$ curl -fsSL https://get.docker.com -o get-docker.sh ...

Get Distributed Systems with Node.js 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.