linux下如何在内网中安装docker


当前第2页 返回上一页

将下列配置加到docker.service中并保存。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

[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

2

3

4

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

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

systemctl start docker    #启动Docker

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

5、验证

1

2

systemctl status docker   #查看Docker状态

docker -v   #查看Docker版本

推荐教程:docker教程

以上就是linux下如何在内网中安装docker的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

如何使用haproxy负载均衡mysql

Linux怎么截图

Linux调试工具gdb使用教程

Linux显示当前路径

Linux常用命令视频教程【推荐】

如何在ecs管理控制台上启动或停止实例

Linux系统如何切换到root用户

Linux中的chattr命令是什么?如何使用(代码示例)

Linux系统下如何切换到root用户

pear Linux是什么意思?

更多相关阅读请进入《Linux》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...