云原生之使用Docker部署docker-compose-ui工具

举报
江湖有缘 发表于 2022/11/02 00:22:33 2022/11/02
【摘要】 云原生之使用Docker部署docker-compose-ui工具

一、Docker Compose UI介绍

Docker Compose UI是Docker Compose的web界面。这个项目的目标是在Docker Compose之上提供一个最小的HTTP API,同时保持与Docker Compose CLI的完全互操作性。

二、检查本地docker环境

1.检查系统版本

[root@node ~]# 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状态

[root@node ~]# 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 Mon 2022-10-31 03:28:51 CST; 1 day 20h ago
     Docs: https://docs.docker.com
 Main PID: 11884 (dockerd)
    Tasks: 44
   Memory: 2.8G
   CGroup: /system.slice/docker.service
           ├─ 11884 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
           ├─ 34936 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8080 -container-ip 172.27.0.3 -container-port 80
           ├─ 34950 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8080 -container-ip 172.27.0.3 -container-port 80
           ├─114721 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 9000 -container-ip 172.17.0.2 -container-port 9000
           └─114726 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 9000 -container-ip 172.17.0.2 -container-port 9000

Nov 01 21:17:48 node dockerd[11884]: time="2022-11-01T21:17:48.427273067+08:00" level=warning msg="Health check for container b5103772dd...xceeded"
Nov 01 21:21:48 node dockerd[11884]: time="2022-11-01T21:21:48.529083655+08:00" level=info msg="Download failed, retrying (4/5): read tc...med out"
Nov 01 21:21:49 node dockerd[11884]: time="2022-11-01T21:21:49.296992135+08:00" level=error msg="Download failed after 6 attempts: read ...med out"
Nov 01 21:21:49 node dockerd[11884]: time="2022-11-01T21:21:49.425397176+08:00" level=info msg="Download failed, retrying (5/5): read tc...med out"
Nov 01 21:22:21 node dockerd[11884]: time="2022-11-01T21:22:21.029219138+08:00" level=info msg="Download failed, retrying (5/5): Get \"https://p...
Nov 01 21:37:54 node dockerd[11884]: time="2022-11-01T21:37:54.734620680+08:00" level=error msg="Not continuing with pull after error: c...anceled"
Nov 01 21:37:54 node dockerd[11884]: time="2022-11-01T21:37:54.794229257+08:00" level=info msg="Layer sha256:a852daa2e2446c73035f696e296...aned up"
Nov 01 21:37:54 node dockerd[11884]: time="2022-11-01T21:37:54.794928818+08:00" level=info msg="Layer sha256:7c34f968f461da4902fc8d2701a...aned up"
Nov 01 21:37:54 node dockerd[11884]: time="2022-11-01T21:37:54.877304029+08:00" level=info msg="Layer sha256:cc75e066235799f16c60bcbb60f...aned up"
Nov 01 21:37:54 node dockerd[11884]: time="2022-11-01T21:37:54.887066340+08:00" level=info msg="Layer sha256:26313e93e01f00837688ac6674e...aned up"
Hint: Some lines were ellipsized, use -l to show in full.



三、下载Docker Compose UI镜像

[root@node ~]# docker pull francescou/docker-compose-ui:1.13.0
1.13.0: Pulling from francescou/docker-compose-ui
81033e7c1d6a: Pull complete 
f7b44c57b95f: Pull complete 
e7d127e5acc6: Pull complete 
100078176fbd: Pull complete 
a7af2069f244: Pull complete 
df34fa004e36: Pull complete 
3afbb4cd8f6c: Pull complete 
c330a147c107: Pull complete 
d13383bf9258: Pull complete 
b5ecad9aaf9f: Pull complete 
Digest: sha256:280598d201e4cb1215ec3c4ca043fddb377a5e2d4729e2c9ab23b34be510e5b6
Status: Downloaded newer image for francescou/docker-compose-ui:1.13.0
docker.io/francescou/docker-compose-ui:1.13.0


四、创建Docker Compose UI镜像

1.创建安装目录

[root@node ~]# mkdir -p /data/compose-ui
[root@node ~]# cd /data/compose-ui/

2.创建Docker Compose UI容器

[root@node compose-ui]# docker run -d --restart always --name docker-compose-ui -p 5000:5000 -w /opt/docker-compose-projects/ -v /var/run/docker.sock:/var/run/docker.sock francescou/docker-compose-ui:1.13.0
df6c0a3d1190d6743ff0b0b8ce1f40c21aa7d38f5a606a7aedc7286161b81627

3.检查容器状态

[root@node compose-ui]# docker ps
CONTAINER ID   IMAGE                                 COMMAND                  CREATED         STATUS                  PORTS                                             NAMES
df6c0a3d1190   francescou/docker-compose-ui:1.13.0   "/env/bin/python /ap…"   2 minutes ago   Up About a minute       0.0.0.0:5000->5000/tcp, :::5000->5000/tcp         docker-compose-ui

4.查看容器日志

[root@node compose-ui]# docker logs docker-compose-ui 
INFO:root:docker-compose version 1.20.1, build 5d8c71b
docker-py version: 3.3.0
CPython version: 2.7.15
OpenSSL version: OpenSSL 1.0.2n  7 Dec 2017
INFO:root:{'node-redis': '/opt/docker-compose-projects/./node-redis', 'volumes-relative-paths': '/opt/docker-compose-projects/./volumes-relative-paths', 'env-demo': '/opt/docker-compose-projects/./env-demo', 'volumes-demo': '/opt/docker-compose-projects/./volumes-demo', 'hello-node': '/opt/docker-compose-projects/./hello-node'}
INFO:werkzeug: * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)

五、访问Docker Compose UI首页

image.png

六、Docker Compose UI基本使用

1.编写docker-compose.yaml文件

image.png

2.运行docker-compose.yaml文件

image.png

3.查看运行日志

image.png

七、在宿主机查看容器运行状态

[root@node compose-ui]# docker ps -a
CONTAINER ID   IMAGE                                  COMMAND                  CREATED          STATUS                    PORTS                                             NAMES
5a86a960f2e4   ghcr.io/linuxserver/dillinger:latest   "/init"                  19 seconds ago   Up 16 seconds             0.0.0.0:8015->8080/tcp, :::8015->8080/tcp         dillinger


【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。