前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >docker离线安装部署 linux_docker官方中文文档

docker离线安装部署 linux_docker官方中文文档

作者头像
全栈程序员站长
发布2022-11-09 16:07:08
9640
发布2022-11-09 16:07:08
举报
文章被收录于专栏:全栈程序员必看

大家好,又见面了,我是你们的朋友全栈君。

linux下离线安装docker

一、基础环境

1、操作系统:centos 7.3

2、docker版本:18.06.1 官方下载地址(打不开可能很慢)

4、官方参考文档:

二、docker安装

1、解压

tar -xvf docker-18.06.1-ce.tgz

2、将解压出来的docker文件内容移动到 /usr/bin/ 目录下

mv docker/* /usr/bin/

3、将docker注册为service

vim /etc/systemd/system/docker.service

将下列配置加到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、启动

chmod +x /etc/systemd/system/docker.service #添加文件权限并启动docker

systemctl daemon-reload #重载unit配置文件

systemctl start docker #启动docker

systemctl enable docker.service #设置开机自启

5、验证

systemctl status docker #查看docker状态

docker -v #查看docker版本

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

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022年9月26日 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
容器镜像服务
容器镜像服务(Tencent Container Registry,TCR)为您提供安全独享、高性能的容器镜像托管分发服务。您可同时在全球多个地域创建独享实例,以实现容器镜像的就近拉取,降低拉取时间,节约带宽成本。TCR 提供细颗粒度的权限管理及访问控制,保障您的数据安全。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档