码迷,mamicode.com
首页 > 其他好文 > 详细

一个docker脚本的学习

时间:2019-08-18 10:14:04      阅读:100      评论:0      收藏:0      [点我收藏+]

标签:rest   ini   roc   star   fail   drive   table   registry   RoCE   

#/bin/bash

tar zxvf docker-app.tar.gz -C /usr/local/bin/

mkdir -p /etc/docker
mkdir -p /etc/docker/certs.d/reg.yunwei.edu

cp ca.crt /etc/docker/certs.d/reg.yunwei.edu/

echo "172.16.254.20 reg.yunwei.edu">>/etc/hosts

cat <<EOF>/etc/docker/daemon.json
{
"registry-mirrors": ["http://cc83932c.m.daocloud.io"],
"max-concurrent-downloads": 10,
"log-driver": "json-file",
"log-level": "warn",
"log-opts": {
"max-size": "10m",
"max-file": "3"
}
}
EOF

cat <<EOF>/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"
ExecStart=/usr/local/bin/dockerd
ExecStartPost=/sbin/iptables -I FORWARD -s 0.0.0.0/0 -j ACCEPT
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 daemon-reload && systemctl enable docker.service && systemctl start docker.service

一个docker脚本的学习

标签:rest   ini   roc   star   fail   drive   table   registry   RoCE   

原文地址:https://www.cnblogs.com/lixingsengde/p/11371303.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!