从零开始devops-快速安装docker
作者:互联网
快速二进制安装docker
操作步骤
下载解压docker
直接上外网下载或接上篇caddy中存放安装包
wget https://download.docker.com/linux/static/stable/x86_64/docker-18.03.1-ce.tgz
tar -xvf docker-18.03.1-ce.tgz
拷贝二进制文件到指定目录
chmod +x docker-18.03.1-ce/*
cp docker-18.03.1-ce/* /usr/local/bin
配置docker源或指定存储路径
注意:graph需要较大的磁盘空间,需要放在较大的磁盘空间上
注意:graph需要较大的磁盘空间,需要放在较大的磁盘空间上
注意:graph需要较大的磁盘空间,需要放在较大的磁盘空间上
vi /etc/docker/daemon.json
{
"registry-mirrors": ["https://registry.docker-cn.com"]
"graph": "/data/docker"
}
添加systemd
生成docker.service的文件并设定到/usr/lib/systemd/system目录下
cat > /usr/lib/systemd/system/docker.service <<"EOF"
[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
EOF
systemctl restart docker
systemctl enable docker
systemctl daemon-reload
systemctl start docker
systemctl enable docker.service
标签:18.03,graph,devops,ce,磁盘空间,从零开始,usr,docker 来源: https://www.cnblogs.com/franzlistan/p/12935830.html