安装Docker以及可视化监控页面Portainer.io

Posted Mr.zhou_Zxy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安装Docker以及可视化监控页面Portainer.io相关的知识,希望对你有一定的参考价值。

1 安装docker

1.1 添加docker到yum源

## 1.安装
[root@hadoop ~]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
-bash: yum-config-manager: 未找到命令

## 2.尝试安装yum-config-manager
[root@hadoop apps]# yum install -y yum-config-manager
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.ustc.edu.cn
 * epel: mirrors.ustc.edu.cn
 * extras: mirrors.ustc.edu.cn
 * updates: mirrors.ustc.edu.cn
没有可用软件包 yum-config-manager。
错误:无须任何处理

## 3.经查询,系统没有这个yum-config-manager命令,在yum-utils包里。
[root@hadoop apps]# yum -y install yum-utils
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
已安装:
  yum-utils.noarch 0:1.1.31-54.el7_8
完毕!

## 4.再次安装
[root@hadoop apps]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
已加载插件:fastestmirror
adding repo from: http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
grabbing file http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo

1.2 安装docker

##2. 安装docker
[root@hadoop yum.repos.d]# yum -y install docker-ce

##3. 配置
[root@hadoop yum.repos.d]# mkdir -p /etc/docker
[root@hadoop yum.repos.d]# mkdir -p /data/apps/docker

##4. 将daemon.json拷贝到/data/apps/docker
##5. 启动docker
[root@hadoop yum.repos.d]# systemctl start docker


[root@hadoop docker]# ps -ef | grep docker
root       5791      1  0 09:04 ?        00:00:00 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
root       6014   1896  0 09:05 pts/0    00:00:00 grep --color=auto docker
[root@hadoop docker]#

docker ps 查看运行中容器(方便停止)

docker stop id

docker ps -a查看所有容易(方便重启和删除)

docker start id

docker rm id

1.3 安装可视化管理页面

查找poratiner版本


[root@hadoop_zxy ~]# docker search portainer
NAME                                DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
6053537/portainer-ce                portainer-ce中文汉化版                               21
lihaixin/portainer                  docker ui                                       15                   [OK]
6053537/portainer                   portainer中文版,完整汉化,汉化程度95%以上                     6
greenled/portainer-stack-utils      Bash scripts to deploy/undeploy stacks in a …   6                    [OK]
portainerci/portainer               Portainer images automatically created via P…   5
cqkz/portainer-zh                   portainer-ce:2.1.1-alpine,汉化文件来自恩山…             3
hassioaddons/portainer                                                              2
softonic/portainer-endpoint         Allows auto register all the swarm nodes in …   1                    [OK]
thibaudlabat/portainer_32           Portainer built for 32bit Linux [ OUTDATED ]…   1
hassioaddons/portainer-armv7                                                        1
xanderstrike/portainer-issue        for illustrating a portainer issue              0
antsoftxyz/portainer-api            A portainer api wrapper which can help you C…   0
portainerci/agent                   Portainer agent images automatically created…   0
portainerci/portainer-ee            Portainer EE CI repository                      0
helloysd/portainer                                                                  0
mitigram/portainer-ce               Easily Configurable Portainer (CE Edition)      0
11384eb/portainer                                                                   0
nenadilic84/portainer                                                               0
iconviet/portainer                                                                  0
hassioaddons/portainer-amd64                                                        0
agiper/portainer                                                                    0
johnvmt/portainer-ecr-credentials   Periodically updates the credentials Portain…   0                    [OK]
webdevsvc/portainer                 portainer                                       0                    [OK]
profidata/portainer                 Fork of portioner/portainer                     0
geosite/portainer                   A Docker UI, This is a fork of portainer/por…   0
[

安装

[root@hadoop_zxy ~]# docker pull 6053537/portainer-ce
Using default tag: latest
latest: Pulling from 6053537/portainer-ce
0ea73420e2bb: Pull complete
c367f59be2e1: Pull complete
a6ce72cb0ef8: Pull complete
Digest: sha256:27608553016612ae5373044376fa3274de3d3c9144e17a16211cb15e3faf2f5a
Status: Downloaded newer image for 6053537/portainer-ce:latest
docker.io/6053537/portainer-ce:latest

运行


[root@hadoop_zxy ~]# docker run -d -p 1000:1000 \\
>  --restart=always \\
> -v /var/run/docker.sock:/var/run/docker.sock \\
> --name prtainer-test \\
> docker.io/portainer/portainer
Unable to find image 'portainer/portainer:latest' locally
latest: Pulling from portainer/portainer
94cfa856b2b1: Pull complete
49d59ee0881a: Pull complete
a2300fd28637: Pull complete
Digest: sha256:fb45b43738646048a0a0cc74fcee2865b69efde857e710126084ee5de9be0f3f
Status: Downloaded newer image for portainer/portainer:latest
5954df65ea1dbe8ef45d1fe742e7bc7a4b7fdad1da1a8cbc01e4049963277a6d

查看

ip+port网页查看

以上是关于安装Docker以及可视化监控页面Portainer.io的主要内容,如果未能解决你的问题,请参考以下文章

[转]Docker容器可视化监控中心搭建

linux安装docker以及可视化管理界面

linux安装docker以及可视化管理界面

zabbix监控docker容器以及使用资源利用率

#yyds干货盘点# Docker环境搭建以及常用技巧可视化

监控 - Prometheus让Docker指标可视化