install-docker

石正信
2023-12-01

Install Docker Engine from binaries

Install daemon and client binaries on Linux

Prereuistes
  • A 64-bit installation
  • Version 3.10 or higher of the Linux kernel.
  • iptables version 1.4 or higher.
  • git version 1.7 or higher
  • A ps executable.
  • XZ Utils 4.9 or higher
  • A properly mounted cgroupfs hierarchy;
    SECURE YOUR ENVIRONMENT AS MUCH AS POSSIBLE
    OS considrations
    Enable SELinux or AppArmor if possible.
Install static binaries
  1. Download the static binary archive.
    docker download
  2. Extract the archive using the tar utility.
tar xzvf /path/to/<FILE>.tar.gz
  1. Move the binaries to a directory on your executable path, such as /usr/bin/.
sudo cp docker/* usr/bin/
  1. Start the Docker daemon:
sudo dockerd &
  1. Verify that Docker is installed correctly by running the hello-word image.
sudo docker run hell-world

Post-installation steps for linux

Manage Docker as a non-root user

To create the docker group and add your user:
1. Create the docker group.
sudo groupadd docker
2. Add your user to the docker group
sudo usermod -aG docker $USER
3. Log out and lob back in so that your group membership is re-evaluated.
On linux, you can also run the following command to activate the changes to groups:
newgrp docker
4. Verify that you can run docker commands without sudo.
docker run hello-world
5. fail, you need this:
reboot
permission denied

Configure Docker to start on boot

docker离线安装并配置docker.service为服务自启动

```
ExecStart=/usr/bin/dockerd # 配置成你自己的路径
```

Config mirror registry

aliyun mirror

 类似资料: