云原生之使用Docker部署Dashdot服务器仪表盘

一、Dashdot介绍

Dashdot是一款简单、实用的开源服务器仪表盘,设计时考虑到了玻璃形态。它旨在用于较小的 VPS 和私人服务器。

二、检查本地系统环境

1.检查本地系统版本

代码语言:shell
复制
[root@jeven ~]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

2.检查docker状态

代码语言:shell
复制
[root@jeven ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2022-12-02 04:34:05 CST; 5 days ago
Docs: https://docs.docker.com
Main PID: 10004 (dockerd)
Tasks: 111
Memory: 2.4G
CGroup: /system.slice/docker.service
├─ 10004 /usr/bin/dockerd -H --containerd=/run/containerd/containerd.sock
├─117192 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 453 -container-ip 192.168.240.2 -container-port 443
├─117198 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 453 -container-ip 192.168.240.2 -container-port 443
├─117211 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8161 -container-ip 192.168.240.2 -container-port 81
├─117217 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8161 -container-ip 192.168.240.2 -container-port 81
├─117229 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8061 -container-ip 192.168.240.2 -container-port 80
├─117235 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8061 -container-ip 192.168.240.2 -container-port 80
├─122772 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 443 -container-ip 172.24.0.2 -container-port 443
├─122778 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 443 -container-ip 172.24.0.2 -container-port 443
├─122792 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8023 -container-ip 172.24.0.2 -container-port 80
├─122797 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8023 -container-ip 172.24.0.2 -container-port 80
├─125465 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8133 -container-ip 192.168.16.2 -container-port 80
├─125470 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8133 -container-ip 192.168.16.2 -container-port 80
├─126264 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8276 -container-ip 172.17.0.2 -container-port 80
└─126270 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8276 -container-ip 172.17.0.2 -container-port 80

Dec 05 17:50:14 jeven dockerd[10004]: time="2022-12-05T17:50:14.411707453+08:00" level=info msg="ignoring event" container=9f858d6ae4bce94...skDelete"
Dec 06 15:39:57 jeven dockerd[10004]: time="2022-12-06T15:39:57.607625402+08:00" level=info msg="Attempting next endpoint for pull after e... unknown"
Dec 06 15:53:59 jeven dockerd[10004]: time="2022-12-06T15:53:59.440205486+08:00" level=info msg="Pull session cancelled"
Dec 06 15:54:02 jeven dockerd[10004]: time="2022-12-06T15:54:02.463174590+08:00" level=error msg="Not continuing with pull after error: er...canceled"
Dec 06 18:41:13 jeven dockerd[10004]: time="2022-12-06T18:41:13.463135348+08:00" level=info msg="Container failed to exit within 10s of si...8d35a3c1d
Dec 06 18:41:13 jeven dockerd[10004]: time="2022-12-06T18:41:13.499299621+08:00" level=info msg="ignoring event" container=0e693c666696382...skDelete"
Dec 06 18:48:15 jeven dockerd[10004]: time="2022-12-06T18:48:15.988272884+08:00" level=info msg="Container failed to exit within 10s of si...e324c7fb7
Dec 06 18:48:16 jeven dockerd[10004]: time="2022-12-06T18:48:16.029722959+08:00" level=info msg="ignoring event" container=e152fa592dbe87d...skDelete"
Dec 06 18:49:26 jeven dockerd[10004]: time="2022-12-06T18:49:26.892043256+08:00" level=error msg="stream copy error: reading from a closed fifo"
Dec 06 18:49:26 jeven dockerd[10004]: time="2022-12-06T18:49:26.893852422+08:00" level=error msg="Error running exec 9caf2e1e743d3da03528224930f13d...
Hint: Some lines were ellipsized, use -l to show in full.

3.检查docker版本

代码语言:shell
复制
[root@jeven ~]# docker -v
Docker version 20.10.17, build 100c701

三、下载Dashdot镜像

代码语言:shell
复制
[root@jeven ~]# docker pull mauricenino/dashdot
Using default tag: latest
latest: Pulling from mauricenino/dashdot
ca7dd9ec2225: Already exists
55371e6747e8: Pull complete
694d6b1b2d1b: Pull complete
71f41f5ff77d: Pull complete
56add475b8c9: Pull complete
7f551cac3db0: Pull complete
4ea3fda37984: Pull complete
19874c2ef6e2: Pull complete
1316aaf09012: Pull complete
8b02555e979e: Pull complete
036180ba4f7a: Pull complete
5356538ccba5: Pull complete
Digest: sha256:e4eb744ee0edf04ac1425596672025411cdab755604e82f97cca5b939bdf0c2b
Status: Downloaded newer image for mauricenino/dashdot:latest
docker.io/mauricenino/dashdot:latest

四、部署Dashdot应用

1.创建安装目录

代码语言:shell
复制
mkdir -p /data/dashdot

2.创建Dashdot容器

代码语言:shell
复制
docker  run  -d  
-p 8987:3001
-v /etc/os-release:/etc/os-release:ro
-v /proc/1/ns/net:/mnt/host_ns_net:ro
--privileged
mauricenino/dashdot

3.查看Dashdot容器状态

代码语言:shell
复制
[root@jeven dashdot]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
71e9dedb50f2 mauricenino/dashdot "docker-entrypoint.s…" 4 seconds ago Up 2 seconds 0.0.0.0:8987->3001/tcp, :::8987->3001/tcp lucid_williams

五、访问Dashdot

image.png
image.png

我正在参与2023腾讯技术创作特训营第三期有奖征文,组队打卡瓜分大奖!