欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

离线安装二进制docker

程序员文章站 2022-03-12 12:41:18
...

解压与权限设置

tar -xvf docker-17.03.0-ce.tgz
chmod +x docker/*

给予执行权限
chmod +s docker/*

拷贝

cp docker/* /usr/local/bin

创建docker service

vim /etc/systemd/system/docker.service

将以下内容粘贴到里面

[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.io
[Service]
Environment="PATH=/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin"
EnvironmentFile=-/run/flannel/docker
ExecStart=/usr/local/bin/dockerd --log-level=error $DOCKER_NETWORK_OPTIONS
ExecReload=/bin/kill -s HUP $MAINPID
Restart=on-failure
RestartSec=5
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Delegate=yes
KillMode=process
[Install]
WantedBy=multi-user.target
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload   //重载systemd下 xxx.service文件
systemctl start docker       //启动Docker
systemctl enable docker.service   //设置开机自启

测试docker

systemctl status docker   //查看Docker状态
docker -v                       //查看Docker版本