docker和docker-compose安装
# docker和docker-compose二进制安装
docker-compose下载地址
https://github.com/docker/compose/releases/download/1.27.4/docker-compose-Linux-x86_64
docker下载地址
Index of linux/static/stable/x86_64/ (opens new window)docker-compose下载地址
https://github.com/docker/compose/releases/download/1.27.4/docker-compose-Linux-x86_64
docker下载地址
docker.service启动服务文件
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service containerd.service
Wants=network-online.target
[Service]
Type=notify
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always
StartLimitBurst=3
StartLimitInterval=60s
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
Delegate=yes
KillMode=process
[Install]
WantedBy=multi-user.target
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# yum安装社区版
# Fedora/CentOS/RHEL
以下内容根据 官方文档 (opens new window) 修改而来。
如果你之前安装过 docker,请先删掉
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
安装一些依赖
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
根据你的发行版下载repo文件:
rocky linux执行:dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
centos7执行:
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
把软件仓库地址替换为 TUNA:
sudo sed -i 's+download.docker.com+mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo
最后安装:
sudo yum makecache fast
sudo yum install docker-ce