当前位置:首页 > 随便写 > 正文内容

安装docker

虚拟化博客2年前 (2023-04-23)随便写209

解压

docker-20.10.2.tgz

tar xzvf docker-20.10.2.tgz
1

复制

sudo cp docker/* /usr/bin/
1

将docker注册为service

vim /etc/systemd/system/docker.service
1
将下列配置加到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
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

添加文件权限

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

重载unit配置文件

systemctl daemon-reload
1

启动Docker

systemctl start docker
1

设置开机自启

systemctl enable docker.service
1

查看Docker状态

systemctl status docker
1

查看Docker版本

docker -v
1

安装portainer界面

加载镜像

portainer.tar 提取码:j7r4

docker image load -i portainer.tar
1

查看镜像

docker images
1

部署镜像

docker run -d --name portainerUI -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer


扫描二维码推送至手机访问。

版权声明:本文由Virtualization esxi pve unRaid vmware synology nas docker blog发布,如需转载请注明出处。

本文链接:http://www.yzme.net/post/59.html

标签: docker
分享给朋友:

相关文章

centos7 逻辑卷扩容

centos7 逻辑卷扩容

新增加一块盘300G,需要增加到/data中。解决方案增加磁盘 -> 初始化物理卷 -> 扩容卷组 -> 扩容逻辑卷操作步骤初始化物理卷查看磁盘信息# lsblkNAME   &nb...

frp配置说明

frp的下载地址:https://github.com/fatedier/frp/releases frp 是一个可用于内网穿透的高性能的反向代理应用,支持 tcp, udp, http, https 协议。frp 的作用利用处于内网或防火...

Docker搭建Maddy多合一邮件服务器

GitHub Chasing66/beautiful_dockerDocker enwaiax/maddy*docker image support for AMD64 and ARM64简介基于 foxcpp...

NGINX的任意反向代理

NGINX的任意反向代理

之前有人分享过php的,但效率有点低。这个是纯NGINX的任意反向代理使用访问地址示例:http://127.0.0.1/https://hostloc.com我做这个的用处就是在某些不方便使用魔法的时候,下载东西,比如github里面的资...

Linux服务器一键DD系统安装纯净版

基本上所有的主机提供商都会提供免费的Linux系统以供安装使用,如CentOS、Debian、Ubuntu等。那为什么我们还要使用一键DD脚本重装/更换系统呢?商家提供的系统版本有限,可能没有自己需要的版本;Windows系统通过正规渠道安...

1分钟安装好独角数卡教程

独角数卡是一款卡密销售系统github https://github.com/assimon/dujiaoka他依赖 mysql 和 redis ,按部就班的装是没问题的,因为作者提供的文档还挺强大,佩服这里主要怎么一分钟无痛的安...

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。