Getting Started with Docker
This article is a quick tutorial on setting up Docker-ce on Ubuntu 20.
- Introduction
- Installation Prerequisites
- Installing Docker
- Post-Configuration
- Testing Docker
- Closing thoughts
- Links
Introduction
“Our first obligation is to keep the foo counters turning.” – Jargon File
This article is a quick tutorial on setting up Docker-ce on Ubuntu 20. It covers the steps necessary to download and install prerequisites, along with deploying and testing Docker.
There are many ways to deploy Docker.The process I’ve documented is the one I personally use, and it is how I’ve been deploying docker-ce in my own home lab environment.
Here are several links to Docker’s official documentation on deployment.
Installation Prerequisites
It’s always a good idea to update before doing installation commands. Doing so ensures we are using the most recent packages.
|
|
Once we have completed the update, we can begin installing the prerequisites for downloading docker-ce
.
|
|
Before adding the Docker repository, we need to download the GPG key and add it to the trusted keys for APT sources. This allows us to trust the new repository.
|
|
Once we have added the key, we can add the Docker repository to the APT sources.
|
|
Installing Docker
Now that we have the Docker repository added, we can begin installing docker-ce
, and its specific
dependencies.
|
|
Once the installation is complete, we can check the docker
service in systemctl
and confirm that
the service is active.
|
|
Post-Configuration
At this point, we should have a fully deployed instance of Docker.The next step is to add the
logged-in user to the docker
security group. This allows docker
specific commands to be run at a
specific user level.
Note: please skip this step if you wish to keep Docker only accessible from a
root-level
account.
|
|
Now that the user is added to the group, we can refresh the active user session with the updated groups.
|
|
Testing Docker
We should now run a quick test to ensure Docker is functioning correctly. We can test by instructing
Docker to create a container with the hello-world
image.
This test will look for a local copy of the image first. Docker will download a fresh copy of the image and create the container if none is found.
|
|
Once Docker has completed the run of hello-world
, we can run a command to show all running and
non-running containers.
|
|
Closing thoughts
Docker should now be fully installed and accessible! I will be adding additional Docker-related articles in the future, so stay tuned, and thank you for reading!