Docker is a tool that is used to run software in a container , Docker was created by developers and for developers. It provides environment stability: a container on the development machine will work exactly the same on staging, production, or any other environment,anywhere.
In this guide, I’ll show you how to install Docker on Ubuntu 20.04 and get started with installing containerized software.
How to install Docker on Ubuntu 20.04:
Open a terminal and typing the following two commands to update your package repository and to download Docker.
$ sudo apt update $ sudo apt install docker.io
Once installation is finshed, start the Docker service and as option ,enable it to run whenever the system is rebooted:
$ sudo systemctl start docker.service $ sudo systemctl enable docker.service
to check Docher version try this
$ sudo docker version
To see how many Docker containers are currently running and see some of Docker’s configured options by entering:
$ sudo docker info
How to run Docker without root:
you’ll have to use sudo
command or login to root any time you want to run a Docker command. This next step is optional, but if you’d prefer the ability to run Docker as your current user, you can add your account to the docker group with this command: (replace $USER with your user in my example bccline:
$ sudo usermod -aG docker $USER
Now ,reboot your system for those changes to take effect.
That is all.
Searching for a Docker image
In Syria , you need to use a VPN to go on < on Ubuntu i suggest VPNgate
1get this link for who to install vpn and usehttps://abakdash.com/2021/01/26/how-to-install-vpngate-on-ubuntu-20-04
If I need to search through Docker for the desired software, I can use the following command
$ sudo docker search [name]
For example let me search for nginx
Install a Docker image
Just as an example, let me try to install the hello-world
package which can be used to make sure that Docker is able to download and run images successfully.
$ sudo docker pull hello-world
The output in the screenshot above indicates that Docker was able to find and download the image I specified.
Example 2
add nginx to docker
Running a Docker image
let me try to run hello-word image
$ sudo docker run hello-world
How to Monitor Docker
To see which Docker containers are running and check their current status, type:
$sudo docker container ls
To see a list of all the Docker images installed, type:
$ sudo docker images
To see the current CPU, RAM, and network usage of running images, type:
$ sudo docker stats
To see Docker’s network configuration, type:
$ sudo docker network ls
end.