我为什么选择 Komodo

不可否认,群晖作为 NAS 界的老大哥,在系统的可用性和可靠性上都非常的出色,但是也有一直一些让人诟病的地方就比如:沟槽的群晖不更新docker的版本,群晖所使用的版本为Docker version 24.0.2,然而该版本最后一次 push 是在三年前。。2026年主流的版本为 v29,也不知道是何原因群晖官方不做更新。

GitHub上已经有项目来更新 docker 的版本,但是这次我并不打算这么做,感兴趣的可以去看看:https://github.com/telnetdoogie/synology-docker

image-20260524225558737

扯远了,老版本的docker会导致很多问题,比如:

  1. compose 文件如果有最新的语法在 container manager 里并不能成功执行。
  2. 我常用的自动更新 docker 的项目 watchtower 官方已经不再维护,而我又不想用第三方fork的版本。

而且 container manager 作为管理软件确实能做的东西比较少,我在云服务器上也有更新docker image的需求,加上Komodo是一个可以AIO远程管理服务器上容器,索性一拍即合,就决定使用 Komodo 来管理我所有平台上的 docker 了。

Komodo 的安装

Komodo 包含了两个组件: Core and Periphery,其中 Periphery 负责收集数据,Core 负责前端。

Component Role
Core Web server hosting the API and browser UI. All user interaction flows through Core.
Periphery Small, stateless agent running on each connected server. Called by Core to perform actions, report system usage, and retrieve container logs.

Komodo 官方文档里提供了两种数据库的选择,我这里选择了 MongoDB,这时你就会发现我上面提到的问题,compose文件如果有最新的语法在container manager里并不能成功执行,这里就是个很好的例子。。compose 中的compose.env文件并不能识别到,所以要做一些调整。

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
64
65
66
67
68
69
70
71
72
################################
# KOMODO COMPOSE - MONGO #
################################

## This compose file will deploy:
## 1. MongoDB
## 2. Komodo Core
## 3. Komodo Periphery

services:
mongo:
image: mongo
labels:
komodo.skip: # Prevent Komodo from stopping with StopAllContainers
command: --quiet --wiredTigerCacheSizeGB 0.25
restart: unless-stopped
# ports:
# - 27017:27017
volumes:
- ./mongo-data:/data/db
- ./mongo-config:/data/configdb
environment:
MONGO_INITDB_ROOT_USERNAME: ${KOMODO_DATABASE_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${KOMODO_DATABASE_PASSWORD}

core:
image: ghcr.io/moghtech/komodo-core:${COMPOSE_KOMODO_IMAGE_TAG:-2}
init: true
restart: unless-stopped
depends_on:
- mongo
ports:
- 9120:9120
env_file: ./.env
environment:
KOMODO_DATABASE_ADDRESS: mongo:27017
volumes:
## Attach the Core / Periphery communication keys
- ./keys:/config/keys
## Store dated backups of the database - https://komo.do/docs/setup/backup
- ${COMPOSE_KOMODO_BACKUPS_PATH}:/backups
## Store sync files on server
# - /path/to/syncs:/syncs
## Optionally mount a custom core.config.toml
# - /path/to/core.config.toml:/config/config.toml
## Optionally mount custom root CA certificate to trust
# - /path/to/root_ca.crt:/usr/local/share/ca-certificates/root_ca.crt

## Deploy Periphery container using this block,
## or deploy the Periphery binary with systemd using
## https://github.com/moghtech/komodo/tree/main/scripts
periphery:
image: ghcr.io/moghtech/komodo-periphery:${COMPOSE_KOMODO_IMAGE_TAG:-2}
init: true
restart: unless-stopped
depends_on:
- core
env_file: ./.env
volumes:
## Attach the Core / Periphery communication keys
- ./keys:/config/keys
## Mount external docker socket
- /var/run/docker.sock:/var/run/docker.sock
## Allow Periphery to see processes outside of container
- /proc:/proc
## Specify the Periphery agent root directory.
## All your configs / repos must be children of this directory for Periphery to be able to see it.
## Must be the same inside and outside the container,
## or docker will get confused. See https://github.com/moghtech/komodo/discussions/180.
## Default: /etc/komodo.
- /volume1/docker:/etc/komodo

Container 的迁移

Komodo 支持导入正在运行的 Compose 项目,只需要在 Komodo 中创建一个 Stack,使用相同的 Compose 文件的,Komodo 就会通过 Compose 项目名称来匹配项目。这就非常方便了。当我拷贝好数据,准备美滋滋的使用 Komodo 的时候,出问题了。。

构建失败的原因是他提示我文件夹不存在: Error response from daemon: Bind mount failed: '/etc/komodo/stacks/freshrss/data' does not exist

image-20260524233207678

但我在 Periphery 的 terminal 中是能看到这个文件夹的,权限也对,就很奇怪。

image-20260524233410090

最终我在一篇 reddit 上找到了和我一个和我有相同问题的哥们人,评论区有人给出了解决方法。。我在compose中使用和很多 ./ 来指示文件夹的位置,这在群晖中似乎有莫名其妙的bug,当我替换成文件夹的绝对路径时,我的 docker 终于跑起来了!

image-20260524233954407

然后将不同位置的机器安装上 Periphery,这样我就拥有了一个可以 AIO 管理所有 docker 的平台!

image-20260524234523375