Docker is a containerized tool that allows applications to run inside containers. This tool ensures that the contained software works smoothly on all devices. This is a great way to make users and developers worry less about operating system compatibility and dependencies.
Docker can be downloaded and installed on most other Linux distributions, including Ubuntu 22.04. You may use Docker to install software packages once installed. It is similar to how you would use your distro’s package management to get an app. Using Docker makes a difference because everything is more automated with compatibility, and dependencies are no longer potential problems.
We will demonstrate in this tutorial how to install Docker on Ubuntu 22.04 Jammy Jellyfish distro.
You need to perform the following steps to install Docker on Ubuntu 22.04:
Open the command line tool “Terminal” and use the following command to update the system repositories:
$ sudo apt update
Once the packages repository is updated, use the following command to download and install Docker on Ubuntu 22.04:
$ sudo apt install docker.io
The previous command will automatically download and install all required Docker packages on your system. Press “Y” and then “Enter” to continue the installation.
Once the Docker installation is completed, enable and start the Docker service by using these commands:
$ sudo systemctl start docker.service $ sudo systemctl enable docker.service
You also verify the Docker running service status by using the following command:
$ sudo systemctl status docker.service
The previous output represents the docker service is enabled and running on your system.
You can verify the Docker installation by displaying the installed version information by using the following command:
$ sudo docker version
In the previous output, you can see the installed Docker version.
You can also use an alternative way to view details about currently running docker containers and the Docker configuration options by using the following command:
$ sudo docker info
To run the Docker command on the Ubuntu system, you need to log in as a root user or “sudo” privileges. So, you will add the current user account into the Docker’s group to run the docker as a non-root user:
$ sudo usermod -aG docker $USER
Now, reboot your system to apply changes:
$ reboot
After installing Docker, you can install images with Docker. Moreover, you can search for a specific image.
To search for a specific application image through Docker, you can use the following command:
$ sudo docker search [image-name]
For example, we want to search for the “hello-world” image. In this case, the previous command will be changed in the following manner:
$ sudo docker search hello-world
As you can see, only one official “hello-world” image is noted in the OFFICIAL column. There are several releases available as well; to learn how they differ from the official image, read their descriptions.
For understanding Docker, we’ll set up the hello-world package that will verify Docker is successfully downloaded and installed on your system. The following command will tell Docker to download the specified software once you know which image you want to install:
$ sudo docker pull hello-world
The previous output shows that Docker can find and download application images.
Once you have downloaded the docker “hello-world” image, you can run it by using this command:
$ sudo docker run hello-world
To verify the proper working of docker, execute the “docker ps” command with the option “-a” to print the information about running docker containers:
$ sudo docker ps –a
The previous output represents that the hello-world docker container is installed successfully. Or you can also run the following command:
$ sudo docker images
If you don’t want to use Docker on your system, you can uninstall it from Ubuntu 22.04 by using the following command:
$ sudo apt purge docker.io
In this article, we learned how to install Docker on Ubuntu 22.04 Jammy Jellyfish distribution. Docker is a very easy-to-use tool on Ubuntu. You need to learn just Docker commands syntax for more understanding. After reading the information provided, you will be able to install new Docker container images and can search for specific software using the “docker search” command.
Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…
Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…
At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…
I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…
Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…
Now I want to share the DNS server installation process on your Ubuntu 20.04 server.…