docker离线安装
下载地址:https://download.docker.com/linux/static/stable/x86_64/
1、将压缩包上传到服务器并解压
tar -zxvf xxx.taz
2、拷贝docker文件夹至/usr/bin/下
cp docker/* /usr/bin/
3、编辑配置文件,加入如下内容
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
4、赋执行权限、开机启动、启动docker
赋执行权限 chmod +x /etc/systemd/system/docker.service systemctl daemon-reload #开机启动 systemctl enable docker.service 启动docker systemctl start docker
5、查看docker版本
docker -v
docker-compose离线安装
下载地址:https://github.com/docker/compose/releases
1、将docker-compose文件移动到/usr/local/bin/下
sudo mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
2、赋予可执行权限
sudo chmod +x /usr/local/bin/docker-compose
3、查看版本验证是否成功
docker-compose -v