详细步骤:
1.下载docker 压缩包,上传到本服务器 ,并解压 tar zxvf docker.tar.gz
2. 进入docker目录复制所有文件到/usr/bin目录下,目的/user/bin是环境变量目录,在路径下都可以运行
docker命令 : cp docker/* /usr/bin/
3. 将docker注册为service
(1)创建文件docker.service
命令:vim /etc/systemd/system/docker.service
(2).将下列配置加到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
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
4.启动
(1)添加文件权限
chmod +x /etc/systemd/system/docker.service
(2)重载配置文件
docker systemctl daemon-reload
systemctl start docker
(3)启动
Docker systemctl enable docker.service
(4) 设置开机自启
5. 验证
(1).查看Docker状态
systemctl status docker
(2). 查看Docker版本
docker -v备注:docker离线安装包和docker.service文件地址:提取码:6avv
linux版离线安装docker
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 一、环境 1. CentenOS 7 内核3.1以上 内核查看命令: uname -a 2. 安装包:docker...
- 前言 有时候会遇到服务器不能联网的情况,这样就没法用yum安装软件,docker也是如此,针对这种情况,总结了一下...
- # centos8.5离线安装docker ## 1、下载docker的安装文件 [https://downloa...