1.docker安装
1.1 下载地址(X86/ARM):
离线下载地址:
https://download.docker.com/linux/static/stable
1.2 将压缩包上传到服务器并解压
tar -zxvf xxx.taz
1.3 拷贝docker文件夹至/usr/bin/下
cp docker/* /usr/bin/
1.4 编辑配置文件,加入如下内容
vim /etc/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
1.5 赋执行权限、开机启动、启动docker
赋执行权限
chmod +x /etc/systemd/system/docker.service
sudo systemctl daemon-reload
#开机启动
sudo systemctl enable docker.service
启动docker
sudo systemctl start docker
1.6 查看docker版本
docker -v
2. docker-compose离线安装
2.1 下载地址(X86/ARM):
https://github.com/docker/compose/releases
2.2 将docker-compose文件移动到/usr/local/bin/下
sudo mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
2.3 赋予可执行权限
sudo chmod +x /usr/local/bin/docker-compose
2.4 查看版本验证是否成功
docker-compose -v
docker-compose在线安装