Install and Set Up Docker
Table of contents
Installation
Docker Desktop is the easiest and most popular way to run Docker on your local workstation. However, there are a number of other solutions that work in nearly-identical ways:
Configuration & Signing In
Most default settings are fine for Docker Desktop. In some cases you might want to allocate more/less CPU or memory to running containers. You can also specify how much disk space can be used for running containers and their storage.
You will also be asked to authenticate Docker Desktop with a free Docker account (enroll here).
Your command-line should already be authenticated (via the Desktop app), so you can push/pull images to Docker Hub. Note that Docker Hub limits the number of images for users in the free tier.
If you intend on pushing images to a container registry other than Docker Hub, you will need to sign into that registry as well from the command-line.
For example, if you want to work with GHCR, the GitHub Container Registry. Be aware that with GHCR you cannot authenticate with a password, but with a PAT (Personal Access Token) instead:
$ docker login ghcr.io
Username: ******
Password: ******
How to create a Personal Access Token (PAT) in GitHub
- Go to https://github.com/settings/tokens
- Generate a new PAT and grant it necessary permissions.
- Expiration can be specified for a length of time. You will be notified when a PAT is about to expire.
- Be sure to copy down the PAT once it is displayed on the screen; it will never be shown to you again.