大家好,又见面了,我是你们的朋友全栈君。
tar -zxvf docker-19.03.12.tgz
cp docker/* /usr/bin
vi /etc/systemd/system/docker.service
复制下列配置到docker.service并保存(:wq)
[Unit]
Description=Docker Application Container EngineDocumentation=https://docs.docker.comAfter=network-online.target firewalld.serviceWants=network-online.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by dockerExecStart=/usr/bin/dockerdExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.LimitNOFILE=infinityLimitNPROC=infinityLimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinityTimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containersDelegate=yes
# kill only the docker process, not all processes in the cgroupKillMode=process
# restart the docker process if it exits prematurelyRestart=on-failureStartLimitBurst=3StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
chmod +x /etc/systemd/system/docker.servi ce
systemctl daemon-reload
systemctl start docker
systemctl enable docker.service
Tip:如果报错检查Selinux是否关闭
/usr/sbin/sestatus -v
vi /etc/selinux/config
reboot
Tip:enabled 开启状态 disabled 关闭状态
上传portainer包https://download.csdn.net/download/qq_27884227/85501735
docker load < portainer.tar
docker run -d -p 9000:9000 --restart=always -v /var/run/docker.sock:/var/run/docker.sock --name dockerui portainer:v19.0.3
将docker-compose文件上传到 /usr/local/bin 修改权限并查看版本
sudo chmod +x /usr/local/bin/docker-compose
docker-compose -v
vi /etc/docker/daemon.json
加入以下内容
{
"log-driver":"json-file",
"log-opts":{
"max-size" :"100m","max-file":"1"}
}
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/189285.html原文链接:https://javaforall.cn