Docker is a free, open-source and cross-platform containerization tool that helps you to deploy and run the application in an isolated environment. Docker has become one of the most important parts of modern software development and DevOps pipelines.
- See More Results
- See Full List On Hub.docker.com
- Ubuntu Downgrade Docker Version
- Ubuntu Docker-compose Version
For modern Docker workflows with Kubernetes, the minimal Ubuntu image provides a balance of compatibility, familiarity, performance and size. This is the standard Ubuntu 18.04 LTS image on the Docker Hub. Cloud images also contain the optimised kernel for each cloud and supporting boot utilities. Fully compatible with all Ubuntu packages.
- The official Docker install doc covers this for Ubuntu 14.04 - look for 'If you'd like to try the latest version of Docker'. Note, the binary will be docker (as opposed to docker.io when provided by Ubuntu).
- See full list on hub.docker.com.
In this tutorial, you will learn –
- A server running Ubuntu 20.04.
- A root password is configured on your server.
Install Docker on Ubuntu
There are two ways to install Docker on Ubuntu 20.04. You can install Docker from the Ubuntu default repository or from the Docker’s official repository. The latest version of Docker is not included in the Ubuntu default repository. So it is always recommended to install Docker from Docker’s official repository.
In this section, we will show you how to install Docker on Ubuntu from Docker official repository.
Step 1 – Install Required Dependencies
First, you will need to install some prerequisite packages in your system. You can install them by running the following command:
Step 2 – Add Docker Official Repository
Next, you will need to import the GPG key and add the Docker repository to your system.
First, import the GPG key with the following command:
Next, add the Docker official repository using the following command:
Once the repository is added, update the repository cache with the following command:
Step 3 – Install Docker Ubuntu
Once the repository is updated, you can install the Docker on Ubuntu by running the following command:
This command will install the latest version of Docker from the Docker official repository.
Step 4 – Verify Docker Version
Once the Docker has been installed, you can verify the installed version of Docker with the following command:
You should get the following output:
Step 5 – Install a Specific Docker Version
If you want to install a specific Docker version, first list all available Docker versions using the following command:
You should see all the Docker version in the following output:
Now, install the specific version of Docker by adding =version after package name as shown below:
Step 6 – Manage Docker Services
To start the Docker service, run the following command:
To enable the Docker service at system reboot, run the following command:
To check the status of Docker service, run the following command:
Run Docker Commands Without Sudo
By default, Docker can be run as a root user or with Sudo privileges. If you want to run Docker commands as a non-root user then you will need to add your user to the docker group.
You can add your user to the docker group using the following command:
Now, your user can run Docker commands without specifying sudo.
Docker Basic Commands
See More Results
You can list all commands available in Docker with the following command:
You should get a list of all commands in the following output:
To see system-wide information about Docker, run the following command:
See Full List On Hub.docker.com
How to Use Docker
At this point, Docker is installed and running in your system. Next, you will need to check whether you can access and download the image from DockerHub.
Let’s download the hello-world image from the DockerHub using the docker pull command:
This will download or pull the hello-world image from the DockerHub repository as shown below:
Next, verify the downloaded image with the following command :
You should see your downloaded image in the following output:
Ubuntu Downgrade Docker Version
Next, run a container from the hello-world image with the following command:
You should see the following output:
How to Uninstall Docker
If you want to uninstallDocker from your system. It is recommended to remove all Docker containers, images and volumes from your system.
Ubuntu Docker-compose Version
First, stop all running containers with the following command:
Once all containers are stopped, remove them with the following command:
Next, remove all Docker images with the following command:
Next, remove all docker objects with the following command:
Finally, remove the Docker package with all dependencies by running the following command:
In the above post, you learned how to install and use Docker on Ubuntu 20.04. To learn more about Docker, check out my all Docker tutorial.