image.png
Three core concepts of Docker: image, container, warehouse
**Image: Similar to the image of a virtual machine, it is an installation file in the common saying. ****Container: Similar to a lightweight sandbox, a container creates an application running instance from an image, which can be started, started, stopped, and deleted, and these containers are isolated from each other and invisible to each other. **** Warehouse: Similar to a code warehouse, it is a place where Docker centrally stores image files. **
Before installing Docker Engine-Community on the new host for the first time, you need to set up the Docker repository.
$ sudo apt-get remove docker docker-engine docker.io containerd runc
$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
Add Docker's official GPG key:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo apt-key fingerprint 0EBFCD88
image.png
Set up the warehouse:
$ sudo add-apt-repository \
" deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
image.png
After setting up the warehouse, you can install Docker Engine-Community
$ sudo apt-get update`
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
It will take a while, wait patiently.
After the installation is complete, verify whether the installation is successful:
$ sudo docker run hello-world
image.png
There is a simpler installation method is to use the script provided by the official website:
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
If you want to use Docker as a non-root user, you should consider adding users to the docker group in a way similar to the following:
$ sudo usermod -aG docker your-user
Ubuntu Docker installation[Install Docker on linux (very simple Installation method)) (https://links.jianshu.com/go?to=https%3A%2F%2Fblog.csdn.net%2Fqq_41723615%2Farticle%2Fdetails%2F93386194)
Recommended Posts