当前位置: 代码网 > it编程>开发工具>Docker > 内网离线安装Docker

内网离线安装Docker

2024年08月06日 Docker 我要评论
Docker内网离线安装

描述

由于机器在内网无法使用yum或rpm安装docker,所以使用的是离线安装。

下载docker离线包地址

https://download.docker.com/linux/static/stable/x86_64/
注:可自行选择版本下载

1、安装docker

1、下载 docker 二进制文件(离线安装包)

wget https://download.docker.com/linux/static/stable/x86_64/docker-18.06.3-ce.tgz

2、上传离线包

通过xshell、ftp等工具上传至内网服务器

3、解压安装包

tar -zxvf docker-18.06.3-ce.tgz

4、将docker 相关命令拷贝到 /usr/bin

cp docker/* /usr/bin/

5、docker注册成系统服务

cat /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
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

6、添加执行权限

chmod +x /etc/systemd/system/docker.service

7、重新加载配置文件

systemctl daemon-reload

8、启动服务

systemctl start docker

9、设置开机自启

systemctl enable docker.service

10、查看状态

systemctl status docker

11、查看docker版本

docker -v
(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com