docs: 部署手册镜像地址改为单仓库格式 iotlcm/iotlcm:<服务名>-<版本>

官方仓库把全部镜像放在同一个镜像仓库 iotlcm/iotlcm 下,靠 tag 区分服务:

  .../iotlcm/iotlcm:mysql-8.0
  .../iotlcm/iotlcm:iotlcm-admin-svr-v1.0.4
  .../iotlcm/iotlcm:iotlcm-app-server-v1.0.2

改动页面:
- prerequisites:镜像仓库章节重写,补充命名空间/镜像仓库/tag 三层结构说明,
  不再提 library/ 命名空间
- configuration:镜像地址示例与 tag 规则表
- build-image:构建命令、命名规则表、基础组件同步脚本、验证命令同步改
- offline:离线镜像清单
- split:分离部署示例

已构建通过,6 个相关页面均可访问。
This commit is contained in:
MiFaZhan
2026-10-30 09:15:42 +08:00
parent 3ab3682d14
commit b4944d7c21
5 changed files with 78 additions and 58 deletions
+45 -36
View File
@@ -79,7 +79,7 @@ docker build \
--build-arg BuildVersion=$VERSION \
--build-arg CommitID=$COMMIT \
--build-arg BuildTime=$BUILD_TIME \
-t your-registry/iotlcm/iotlcm-openapi:$VERSION \
-t your-registry/iotlcm/iotlcm:iotlcm-openapi-$VERSION \
.
```
@@ -91,7 +91,7 @@ docker build \
--build-arg BuildVersion=$VERSION \
--build-arg CommitID=$COMMIT \
--build-arg BuildTime=$BUILD_TIME \
-t your-registry/iotlcm/iotlcm-admin-svr:$VERSION \
-t your-registry/iotlcm/iotlcm:iotlcm-admin-svr-$VERSION \
-f server/build/Dockerfile server/
```
@@ -99,12 +99,12 @@ docker build \
```bash
cd iotlcm-admin-ui/vue
docker build -t your-registry/iotlcm/iotlcm-admin-ui:$VERSION -f build/Dockerfile .
docker build -t your-registry/iotlcm/iotlcm:iotlcm-admin-ui-$VERSION -f build/Dockerfile .
```
```bash
cd iotlcm-app/app
docker build -t your-registry/iotlcm/iotlcm-app-web:$VERSION .
docker build -t your-registry/iotlcm/iotlcm:iotlcm-app-web-$VERSION .
```
### 构建参数说明
@@ -123,24 +123,32 @@ docker build --build-arg GOPROXY=https://goproxy.cn,direct -t ... .
## 镜像命名规则
部署编排按以下名称拉取镜像,自建时需保持一致。`<镜像仓库>` 即官方仓库前缀 `crpi-qflrqrxoohlkkvgc.cn-chengdu.personal.cr.aliyuncs.com`:
官方仓库把**所有镜像放在同一个镜像仓库** `iotlcm/iotlcm` 下,靠 tag 区分服务与版本:
| 服务 | 镜像名 |
| --- | --- |
| admin-svr | `<镜像仓库>/iotlcm/iotlcm-admin-svr:<TAG>` |
| admin-ui | `<镜像仓库>/iotlcm/iotlcm-admin-ui:<TAG>` |
| openapi | `<镜像仓库>/iotlcm/iotlcm-openapi:<TAG>` |
| app-server | `<镜像仓库>/iotlcm/iotlcm-app-server:<TAG>` |
| app-web | `<镜像仓库>/iotlcm/iotlcm-app-web:<TAG>` |
| upstream-chan | `<镜像仓库>/iotlcm/iotlcm-upstream-chan:<TAG>` |
| upstream-proxy | `<镜像仓库>/iotlcm/iotlcm-upstream-proxy:<TAG>` |
| worker-svr | `<镜像仓库>/iotlcm/iotlcm-worker-svr:<TAG>` |
| sms | `<镜像仓库>/iotlcm/iotlcm-sms:<TAG>` |
| bot | `<镜像仓库>/iotlcm/iotlcm-bot:<TAG>` |
| docs | `<镜像仓库>/iotlcm/iotlcm-docs:<TAG>` |
| onelink-mock | `<镜像仓库>/iotlcm/iotlcm-onelink-mock:<TAG>` |
```text
<Registry>/iotlcm/iotlcm:<服务名>-<版本>
```
基础组件(`mysql`、`redis`、`rabbitmq`、`consul`、`nginx`)不需要构建,只需从上游同步到 `<镜像仓库>/library/`,见下节。
| 服务 | tag | 完整示例 |
| --- | --- | --- |
| admin-svr | `iotlcm-admin-svr-<TAG>` | `.../iotlcm/iotlcm:iotlcm-admin-svr-v1.0.4` |
| admin-ui | `iotlcm-admin-ui-<TAG>` | `.../iotlcm/iotlcm:iotlcm-admin-ui-v1.0.4` |
| openapi | `iotlcm-openapi-<TAG>` | `.../iotlcm/iotlcm:iotlcm-openapi-v1.0.4` |
| app-server | `iotlcm-app-server-<TAG>` | `.../iotlcm/iotlcm:iotlcm-app-server-v1.0.2` |
| app-web | `iotlcm-app-web-<TAG>` | `.../iotlcm/iotlcm:iotlcm-app-web-v1.0.2` |
| upstream-chan | `iotlcm-upstream-chan-<TAG>` | `.../iotlcm/iotlcm:iotlcm-upstream-chan-v1.0.4` |
| upstream-proxy | `iotlcm-upstream-proxy-<TAG>` | `.../iotlcm/iotlcm:iotlcm-upstream-proxy-v1.0.4` |
| worker-svr | `iotlcm-worker-svr-<TAG>` | `.../iotlcm/iotlcm:iotlcm-worker-svr-v1.0.4` |
| sms | `iotlcm-sms-<TAG>` | `.../iotlcm/iotlcm:iotlcm-sms-v1.0.4` |
| bot | `iotlcm-bot-<TAG>` | `.../iotlcm/iotlcm:iotlcm-bot-v1.0.4` |
| docs | `iotlcm-docs-<TAG>` | `.../iotlcm/iotlcm:iotlcm-docs-v1.0.4` |
| onelink-mock | `iotlcm-onelink-mock-<TAG>` | `.../iotlcm/iotlcm:iotlcm-onelink-mock-v1.0.4` |
基础组件(`mysql`、`redis`、`rabbitmq`、`consul`、`nginx`)不需要构建,从上游同步到同一仓库即可,tag 为 `<组件>-<版本>`,见下节。
::: warning tag 必须带上服务名
同一个仓库里 tag 不能重复。只用版本号(如 `v1.0.4`)会让 12 个服务互相覆盖,因此 tag 固定为 `<服务名>-<版本>`。
:::
## 同步基础组件
@@ -155,27 +163,28 @@ docker login --username=sdqmx $REPO
sync_image() {
local src=$1 dst=$2
docker pull "$src"
docker tag "$src" "$REPO/library/$dst"
docker push "$REPO/library/$dst"
docker tag "$src" "$REPO/iotlcm/iotlcm:$dst"
docker push "$REPO/iotlcm/iotlcm:$dst"
}
sync_image mysql:8.0 mysql:8.0
sync_image redis:7.2 redis:7.2
sync_image rabbitmq:4.3.5-management rabbitmq:4.3.5-management
sync_image hashicorp/consul:1.22 consul:1.22
sync_image nginx:1.30 nginx:1.30
# 参数:<上游镜像> <目标 tag(组件名-版本)>
sync_image mysql:8.0 mysql-8.0
sync_image redis:7.2 redis-7.2
sync_image rabbitmq:4.3.5-management rabbitmq-4.3.5-management
sync_image hashicorp/consul:1.22 consul-1.22
sync_image nginx:1.30 nginx-1.30
```
::: warning 同步时把版本号固定到补丁位
`mysql:8.0` 这类浮动 tag 会随上游发新补丁而变化。建议同步时锁定到具体补丁版(如 `mysql:8.0.43`),并把 `docker-compose.yml` 的 `MYSQL_VERSION` 同步改为 `8.0.43`,保证多台机器拉到的镜像完全一致。
`mysql:8.0` 这类浮动 tag 会随上游发新补丁而变化。建议同步时锁定到具体补丁版(如 `mysql:8.0.43`),tag 写成 `mysql-8.0.43`,并把 `docker-compose.yml` 里对应的 `image` 同步改掉,保证多台机器拉到的镜像完全一致。
:::
同步完成后校验:
```bash
for img in mysql:8.0 redis:7.2 rabbitmq:4.3.5-management consul:1.22 nginx:1.30; do
docker manifest inspect "$REPO/library/$img" >/dev/null 2>&1 \
&& echo "✅ $img" || echo "❌ $img"
for tag in mysql-8.0 redis-7.2 rabbitmq-4.3.5-management consul-1.22 nginx-1.30; do
docker manifest inspect "$REPO/iotlcm/iotlcm:$tag" >/dev/null 2>&1 \
&& echo "✅ $tag" || echo "❌ $tag"
done
```
@@ -187,14 +196,14 @@ done
REG=harbor.internal.example.com
TAG=1.0.3
docker tag iotlcm-openapi:local $REG/iotlcm/iotlcm-openapi:$TAG
docker tag iotlcm-openapi:local $REG/iotlcm/iotlcm:iotlcm-openapi-$TAG
docker login $REG
docker push $REG/iotlcm/iotlcm-openapi:$TAG
docker push $REG/iotlcm/iotlcm:iotlcm-openapi-$TAG
```
```yaml
# docker-compose.yml —— 逐个替换 image 前缀
image: 'harbor.internal.example.com/iotlcm/iotlcm-openapi:1.0.3'
image: 'harbor.internal.example.com/iotlcm/iotlcm:iotlcm-openapi-v1.0.4'
```
::: tip 只覆盖部分服务
@@ -262,10 +271,10 @@ echo "全部完成,镜像标签:$REPO/iotlcm/*:$TAG"
docker images | grep iotlcm
# 二进制能否启动
docker run --rm your-registry/iotlcm/iotlcm-openapi:$TAG --help 2>&1 | head
docker run --rm your-registry/iotlcm/iotlcm:iotlcm-openapi-$TAG --help 2>&1 | head
# 检查架构
docker inspect your-registry/iotlcm/iotlcm-openapi:$TAG \
docker inspect your-registry/iotlcm/iotlcm:iotlcm-openapi-$TAG \
--format '{{.Architecture}}/{{.Os}}'
```