Docker installation mode

Docker CE can be installed on Linux, Windows 10 and MacOS.

The official installation guide address: docs.docker.com/engine/inst…

CentOS install Docker

  • System requirements: Docker CE supports 64-bit CentOS 7, and the kernel version must be at least 3.10.
  • Sudo yum remove docker docker-common docker-selinux docker-engine
  • Sudo yum install docker-ce
  • Install with a script:
  1. To obtain the script: curl -fssl get.docker.com -o get-docker.sh
  2. Executable permission: chmod +x get-docker.sh
  3. Sudo sh get-docker.sh –mirror Aliyun
  4. After executing this command, the script automatically does all the preparatory work and installs the Edge version of Docker CE

Start the docker CE

1. sudo systemctl enable docker	# Set to enable boot
2. sudo systemctl start docker
3. sudo service docker start
Copy the code

Create a Docker user group

By default, docker commands communicate with the Docker engine using Unix sockets. Only root users and docker group users can access the Unix socket of the Docker engine. It is not directly used on Linux systems

- sudo groupadd docker	Create a docker group
- sudo usermod -aG docker $USER	Add the current user to the docker group
Copy the code

Test whether Docker is installed correctly

docker run hello-world	Start a container based on the Hello-world image
Copy the code

If the preceding information is displayed, the installation is successful

Mirror accelerator

1. sudo mkdir -p /etc/docker
2.
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://koap82xi.mirror.aliyuncs.com"]
}
EO
3. sudo systemctl daemon-reload
4. sudo systemctl restart docker
Copy the code