Centos离线安装docker
2023-06-13 09:15:25 时间
- 下载tagbao
- tar -xvf docker-18.06.1-ce.tgz
- cp docker/* /usr/bin/
- 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
# 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 docker
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2376 -H unix://var/run/docker.sock
ExecReload=/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=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
- chmod +x /etc/systemd/system/docker.service
- systemctl daemon-reload
- systemctl start docker #启动Docker
- systemctl enable docker.service #设置开机自启
- systemctl status docker #查看Docker状态
- docker -v #查看Docker版本
相关文章
- docker 权限问题 Got permission denied while trying to connect to the Docker daemon socket at 。。。「建议收藏」
- CentOS-yum卸载docker环境
- CentOS安装docker
- docker(2)CentOS 7安装docker环境「建议收藏」
- centos7.4安装docker_docker运行centos
- centos配置docker环境
- 「 【Docker】如何处理宝塔docker管理器未启动 」
- 【Docker 系列】docker 学习十,Compose 编写规则及wp 实战
- Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running
- Docker安装Centos详解架构师
- Centos步骤简明教程:安装Oracle 11g(centos安装oracle11g)
- 使用Docker安装Redis并配置成功(docker安装redis)
- CentOS与Linux:非凡之旅(centos和linux)
- CentOS安装MySQL 解决复杂数据库问题(centos安装mysql)
- 怎么安装CentOS下MySQL的安装教程(centos里mysql)
- CentOS进驻MySQL轻松让您拥有数据库管理权(centos进mysql)
- centOS安装MySQL更为稳定便捷的选择(centos-mysql)