76 Commits
11 .. 12

Author SHA1 Message Date
endial e6bf27ffbd feat: 更新 Submodule 版本,支持单段纯数字分支生成标签
ci/woodpecker/push/woodpecker Pipeline was successful
2026-01-20 11:31:46 +08:00
endial 22618a3afc docs: 更新说明文档
ci/woodpecker/push/woodpecker Pipeline was successful
2026-01-20 10:28:04 +08:00
endial ca08ec80c9 feat: 删除Dockerfile中的架构参数 2026-01-20 10:27:57 +08:00
endial 6051d086cc feat: 更新本地编译脚本 2026-01-20 10:27:44 +08:00
endial 0ad2246f4a feat: 更新用户自定义配置路径 2026-01-20 10:23:18 +08:00
endial 638669785f feat: 更新 Submodule 版本
ci/woodpecker/push/woodpecker Pipeline was successful
2026-01-13 17:00:01 +08:00
endial cdc14df2d9 feat: 更新 Submodule 版本
ci/woodpecker/push/woodpecker Pipeline was successful
2026-01-13 16:55:18 +08:00
endial 7056b403da feat: 更新 Submodule 版本
ci/woodpecker/push/woodpecker Pipeline was successful
2026-01-13 16:29:29 +08:00
endial 99f002f94e fix: 修复流水线配置中触发条件错误[SKIP CI] 2026-01-13 10:53:09 +08:00
endial 3b05d2a05d feat: 更新为基于 Woodpecker 流水线的编译版本
ci/woodpecker/push/woodpecker Pipeline was successful
2026-01-12 18:20:39 +08:00
endial 57b908ebea merge:合并主分支 2025-04-21 11:23:31 +08:00
endial 6392a92452 feat: 删除脚本中的命令回显 2025-04-21 11:15:50 +08:00
endial 19dd3b17b0 feat: 变更脚本库文件至/usr/local 2025-04-21 11:15:03 +08:00
endial 5f6f1dd229 feat: 增加粗体定义 2025-04-21 09:21:02 +08:00
endial e0938e3468 docs: 更新描述文档 2025-04-09 17:33:09 +08:00
endial e7e0ebba82 feat: 优化脚本,删除无用信息 2025-04-09 17:32:03 +08:00
endial e5b822b354 docs: 更新描述文档 2025-04-09 16:34:52 +08:00
endial 5117f79d44 docs: 更新描述文档 2025-04-09 16:34:03 +08:00
endial e6413d9018 feat: 更新镜像打包脚本 2025-04-09 09:04:28 +08:00
endial 4bfc4341bb feat: 合并12版本分支的修改,删除无效文件 2025-04-08 11:07:03 +08:00
endial b6192f1eea feat: 脚本增加执行权限 2025-04-08 10:57:26 +08:00
endial 205cfb1b24 feat: 合并12版本分支的修改 2025-04-08 10:56:25 +08:00
endial 9208145f7d feat: 更新默认shell脚本 2025-04-08 10:49:21 +08:00
endial 02fe9112bd feat: 更新工具脚本 2025-04-07 12:04:15 +08:00
endial b0d7ef1443 feat: 更新编译脚本 2025-04-07 12:02:16 +08:00
endial 541bedc8d7 docs: 更新描述文档 2025-04-07 11:59:49 +08:00
endial 7981754a15 feat: 变更使用新版Dockerfile模板 2023-09-06 14:57:44 +08:00
endial 9b0c36f9b4 feat: 变更使用新版Dockerfile模板 2023-09-06 14:57:32 +08:00
endial 09c9b94fe6 feat: 本地编译脚本增加main/master分支的识别 2023-09-06 14:51:59 +08:00
endial 9308353269 feat: 本地编译脚本增加main/master分支的识别 2023-09-06 14:51:34 +08:00
endial 7458ddbb04 docs: 更新文档中有关镜像仓库地址 2023-09-06 14:49:32 +08:00
endial e7ace2f265 docs: 更新文档中有关镜像仓库地址 2023-09-06 14:49:16 +08:00
endial ea5a08d2a1 feat: 更新临时镜像清理命令 2023-09-06 14:36:06 +08:00
endial 687ad446b1 feat: 更新临时镜像清理命令 2023-09-06 14:35:49 +08:00
endial 811a173bcb feat: 更新Docker打包时的忽略信息 2023-09-06 14:34:48 +08:00
endial 33bca9c36a feat: 更新Docker打包时的忽略信息 2023-09-06 14:33:15 +08:00
endial b95c1f1e6b feat: 更新脚本库路径 2023-08-14 10:01:12 +08:00
endial a1854ff46b feat: 更新本地编译命令 2023-08-14 10:00:50 +08:00
endial 6a5e8bd8b1 feat: 更新脚本库路径 2023-08-14 09:59:45 +08:00
endial 26cefdf70a feat: 更新常用脚本库路径;删除 Docker Hub Hooks 2023-08-14 09:59:05 +08:00
endial f96ab0856f fix: 因为runner为动态分配,清理工作应该在每个阶段直接执行 2023-08-11 09:44:25 +08:00
endial e558641efa fix: 因为runner为动态分配,清理工作应该在每个阶段直接执行 2023-08-11 09:43:54 +08:00
endial fc7a702490 feat: 更新本地缓存资源路径 2023-08-11 09:34:41 +08:00
endial c4d6c6139c feat: 更新本地缓存资源路径 2023-08-11 09:34:21 +08:00
endial baa4ae442e feat: 增加 CI/CD 清理临时资源处理 2023-08-11 09:26:54 +08:00
endial 71dbb24855 feat: 增加 CI/CD 清理临时资源处理 2023-08-11 09:25:55 +08:00
endial fbab292cf6 fix: 帮助命令增加检测参数 2023-08-04 17:11:25 +08:00
endial 105cd5ea48 fix: 帮助命令增加检测参数 2023-08-04 17:09:10 +08:00
endial 640e5d76db feat: 优化 Dockerfile 2023-08-04 14:14:18 +08:00
endial 7ba5c9d5b2 feat: 增加默认 LICENSE 文件,优化镜像层数 2023-08-04 14:12:22 +08:00
endial cc7856e226 feat: 更新系统管理工具脚本 2023-08-04 14:12:22 +08:00
endial 0eab6d2e54 feat: 更新 CI/CD 编译阶段定义 2023-08-04 14:12:22 +08:00
endial a4bd3c4fe0 fix: 解决 APP_NAME 未定义时脚本退出问题 2023-08-04 14:12:22 +08:00
endial 77063b241a feat: 更新系统源定义 2023-08-04 14:12:22 +08:00
endial e89f4671f1 feat: 优化 Dockerfile 2023-08-04 14:00:33 +08:00
endial 7c4c814866 feat: 增加默认 LICENSE 文件,优化镜像层数 2023-08-04 12:13:48 +08:00
endial fb22f8a250 feat: 更新系统管理工具脚本 2023-08-04 12:02:41 +08:00
endial 1023af1160 feat: 更新 CI/CD 编译阶段定义 2023-08-04 11:16:26 +08:00
endial 4cac36aa57 fix: 解决 APP_NAME 未定义时脚本退出问题 2023-08-04 11:13:16 +08:00
endial 9b3ba3c09c feat: 更新系统源定义 2023-08-04 11:12:36 +08:00
endial 8ba9e0795d feat: 更新 Colovu 脚本存储路径 2023-08-04 10:25:54 +08:00
endial 2bf365e2ab feat: 更新环境变量定义及脚本调用(APP_NAME/APP_VER) 2023-08-03 12:31:31 +08:00
endial 952dd74fce feat: 更新环境变量定义及脚本调用(APP_NAME/APP_VER) 2023-08-03 12:30:32 +08:00
endial 455242e2cb feat: CI/CD 增加 tag 选择编译环境 2023-08-02 09:24:08 +08:00
endial b63661dd2c feat: CI/CD 增加 tag 选择编译环境 2023-08-02 09:17:42 +08:00
endial 3a471d8ccd fix: 解决默认软件源配置错误 2023-07-31 16:09:50 +08:00
endial c0d5cebd8e fix: 解决默认软件源配置错误 2023-07-31 16:07:38 +08:00
endial df94964234 fix: 解决默认软件源配置错误 2023-07-31 15:45:37 +08:00
endial 702905b7eb fix: 解决默认软件源配置错误 2023-07-31 15:28:51 +08:00
endial 6b87f72424 feat: 更新 Dockerfile 中变量定义及使用方式 2023-07-28 09:25:31 +08:00
endial 4a2f272762 feat: 更新 Dockerfile 中变量定义及使用方式 2023-07-28 09:22:28 +08:00
endial db31eece54 docs: 更新文档中有关acr描述信息 2023-07-28 08:59:00 +08:00
endial 3152a73294 docs: 更新文档中有关acr描述信息 2023-07-28 08:57:48 +08:00
endial d96d9f00a7 docs: 更新版本描述信息 2023-07-27 17:41:24 +08:00
endial 7ba68b9919 feat: 更新为 Debian 12 2023-07-27 17:37:56 +08:00
endial 5b61fb11d9 feat: 更新 Debian 12 的 apt 源信息及对应的脚本文件 2023-07-27 17:37:19 +08:00
12 changed files with 384 additions and 1 deletions
Submodule
+1
Submodule .ci/common added at b0ca0dc3a3
+12
View File
@@ -0,0 +1,12 @@
.git
.gitignore
.gitmodules
./Makefile
*.yml
*.yaml
./LICENSE
./README.md
./img
+26
View File
@@ -0,0 +1,26 @@
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon\r\r
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
+3
View File
@@ -0,0 +1,3 @@
[submodule ".ci/common"]
path = .ci/common
url = https://git.colovu.com/docker/common.git
+55
View File
@@ -0,0 +1,55 @@
# 注意:
# 1. git commit 信息中包含"[CI SKIP]"或"[SKIP CI]"则不触发工作流(注意大小写)
# 2. 工作步骤中包含 volumes 挂载时,需在 Woodpecker 配置中添加 volumes 挂载信任(Trust
# 3. lables 配置项,可配置多个;如果存在,则必须完全符合 Runner 创建时设置的 Lables 配置项
# 4. command 中,引用自定义变量不能使用`${VAR}`方式,需要使用`$VAR`方式;带花括号的变量,会在 Woodpecker 模板引擎解析阶段被替换(此时变量为空)
# 5. 多架构编译后推送至 SWR 报错,或单架构编译后必须在推送时明确指定架构信息才能推送;可通过在编译命令中增加参数`--provenance=false --sbom=false`解决
# 6. 使用 Git Submodule 管理通用脚本时,需手动更新 Submodule
when:
# 匹配 main
- event: push
branch: main
# 匹配 master
- event: push
branch: master
# 匹配数字开头的分支,如 1.0, 2, 3.2.1
- event: push
branch: "[0-9]*"
# 匹配 v 开头的版本分支,如 v1, v2.0
- event: push
branch: "v[0-9]*"
# 匹配 tag 事件
- event: tag
ref: "refs/tags/(v?[0-9].*)"
labels:
runtime: docker
arch: amd64
multiarch: "true"
steps:
- name: 初始化子模块
image: alpine/git
commands:
- git submodule update --init --recursive
- name: 编译并推送镜像
image: docker:cli
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
SWR_REGISTRY: "swr.cn-north-4.myhuaweicloud.com"
DOCKER_CLI_EXPERIMENTAL: enabled
SWR_USERNAME:
from_secret: swr_colovu_user
SWR_PASSWORD:
from_secret: swr_colovu_passwd
commands:
- |
# 直接执行 Submodule .ci/common 下的构建推送脚本
if [ ! -f ".ci/common/build_push.sh" ]; then
echo "错误: 未找到 .ci/common/build_push.sh 脚本"
exit 1
fi
- sh ./.ci/common/build_push.sh
+72
View File
@@ -0,0 +1,72 @@
# Ver: 1.11 by Endial Fang (endial@126.com)
#
# 系统默认变量 ====================================================================
# 该部分变量为系统根据编译命令默认设置
# `TARGETPLATFORM`:构建后的目标平台信息。如 `linux/amd64``linux/arm/v7``windows/amd64`
# `TARGETOS`:目标平台信息(TARGETPLATFORM)中的操作系统部分,如:`linux`、`windows`
# `TARGETARCH`:目标平台信息(TARGETPLATFORM)中的平台架构部分,如:`amd64`、`arm`
# `TARGETVARIANT`:目标平台信息(TARGETPLATFORM)中的版本变体部分,如:`v7`
# `BUILDPLATFORM`:用于构建的节点平台信息
# `BUILDOS`:用于构建的节点平台信息(BUILDPLATFORM)中的操作系统部分
# `BUILDARCH`:用于构建的节点平台信息(BUILDPLATFORM)中的平台架构部分
# `BUILDVARIANT`:用于构建的节点平台信息(BUILDPLATFORM)中的版本变体部分
# 可变参数 ========================================================================
# 该部分变量,在编译命令中通过 `--build-arg` 传入;如果未设置,则使用下面对应的默认值
ARG APP_NAME=debian
ARG APP_VER=12
ARG REGISTRY_URL="docker.io/"
ARG APT_SOURCE=aliyun
# 1. 生成镜像 =====================================================================
FROM ${REGISTRY_URL}debian:${APP_VER}-slim
# 声明需要使用的全局可变参数(ARG声明的变量仅编译打包阶段有效)
ARG APP_NAME
ARG APP_VER
ARG APT_SOURCE
# 镜像元数据标签 - 符合OCI镜像规范
LABEL org.opencontainers.image.title="${APP_NAME}" \
org.opencontainers.image.version="${APP_VER}" \
org.opencontainers.image.description="Docker image for Debian LTS Slim." \
org.opencontainers.image.authors="Endial Fang <endial@126.com>" \
org.opencontainers.image.url="https://gitee.com/colovu/docker-${APP_NAME}" \
org.opencontainers.image.vendor="Endial Fang (colovu)" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.source="https://gitee.com/colovu/docker-${APP_NAME}" \
org.opencontainers.image.documentation="https://gitee.com/colovu/docker-${APP_NAME}/blob/main/README.md" \
maintainer="Endial Fang <endial@126.com>"
# 拷贝源仓库配置文件
COPY customer /
# 拷贝默认的通用脚本文件
COPY .ci/common/debian /
# 选择软件包源,安装常用软件包,配置locale和时区,并清理缓存
RUN set -eux; \
\
select_source ${APT_SOURCE}; \
\
install_pkg gosu dumb-init curl locales; \
\
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen; \
locale-gen; \
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_MESSAGES=POSIX; \
dpkg-reconfigure -f noninteractive locales; \
\
ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime; \
dpkg-reconfigure -f noninteractive tzdata; \
\
apt-get clean && rm -rf /var/lib/apt/lists/*
# 在安装像相应软件包后,设置对应的环境变量
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \
LC_ALL=en_US.UTF-8
# 应用程序的服务命令,必须使用非守护进程方式运行。如果使用变量,则该变量必须在运行环境中存在(ENV可以获取)
CMD []
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Endial Fang (endial@126.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+133 -1
View File
@@ -1,3 +1,135 @@
# Debian
停止维护 Debian 11 版本.
[Debian 系统](https://www.debian.org/)的基础 Docker 镜像。基于官方 [Debian LTS Slim 版本](https://hub.docker.com/_/debian) 镜像。
**版本信息:**
- 12bookworm
**镜像信息:**
* 镜像地址:
* 华为云: swr.cn-north-4.myhuaweicloud.com/colovu/debian
* 依赖镜像:docker.io/library/debian:12-slim
registry.colovu.com/docker-proxy/debian:12-slim
> 后续相关命令行默认使用华为云 SWR 镜像服务器做说明。
**与官方镜像差异:**
- 增加 `default、ustc、aliyun` 源配置文件,可在编译时通过 `ARG` 变量`APT_SOURCE`进行选择
- 增加常用 Shell 脚本文件
- 更新已安装的软件包
- 增加`locales`,并设置默认编码格式为`en_US.utf8`
- 设置默认时区信息为 `Asia/Shanghai`
- 增加`gosu`软件,用作镜像的 non-root 应用执行
- 增加`dumb-init`软件,用作镜像的入口命令,以确保中断被正确响应和转发
- 增加`curl`软件,用作镜像健康检查
## TL;DR
Docker 快速启动命令:
```shell
# 从 Registry 服务器下载镜像并启动
docker run -it swr.cn-north-4.myhuaweicloud.com/colovu/debian:12 /bin/bash
```
---
## 使用说明
**下载镜像:**
```shell
docker pull swr.cn-north-4.myhuaweicloud.com/colovu/debian:12
```
- 12:为镜像的 TAG,可针对性选择不同的 TAG 进行下载;可使用`latest`选择最新的镜像
- 不指定 TAG 时,默认下载`latest`镜像
**查看镜像:**
```shell
docker images
```
**命令行方式运行容器:**
```shell
docker run -it --rm swr.cn-north-4.myhuaweicloud.com/colovu/debian:12 /bin/bash
```
- `-it`:使用交互式终端启动容器
- `--rm`:退出时删除容器
- `swr.cn-north-4.myhuaweicloud.com/colovu/debian:12`:镜像名称及版本标签
- `/bin/bash`:在容器中执行`/bin/bash`命令;如果不执行命令,容器会在启动后立即结束并退出。
以该方式启动后,直接进入容器的命令行操作界面。如果需要退出,直接使用命令`exit`退出。
**后台方式运行容器:**
```shell
docker run -d --name debian swr.cn-north-4.myhuaweicloud.com/colovu/debian:12 tail /dev/stderr
```
- `--name debian`:命名容器为`debian`,可按照实际情况自定义容器名称
- `-d`:以后台进程方式启动容器
- `swr.cn-north-4.myhuaweicloud.com/colovu/debian:12`:镜像名称及版本标签
- `tail /dev/stderr`:在容器中执行`tail /dev/stderr`命令,以防止容器直接退出
以该方式启动后,如果想进入容器,可以使用以下命令:
```shell
docker exec -it debian /bin/bash
```
- `-it`:使用交互式执行
- `debian`:之前启动的容器名
- `/bin/bash`:执行的命令
## 配置修改
### 修改时区信息
可在生成镜像时或容器初始化 Shell 脚本中,使用以下命令:
```shell
# 修改时区为 UTC
ln -fs /usr/share/zoneinfo/UTC /etc/localtime
# 重新配置系统
dpkg-reconfigure -f noninteractive tzdata
```
更新成功后会显示当前时区信息,如:
```shell
Current default time zone: 'Etc/UTC'
Local time is now: Tue Jul 21 09:16:14 UTC 2020.
Universal Time is now: Tue Jul 21 09:16:14 UTC 2020.
```
### 修改字符编码格式
可在生成镜像时或容器初始化 Shell 脚本中,使用以下命令:
``` shell
# 更改默认字符编码为 zh_CN.UTF-8
sed -i -e 's/# zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
update-locale LC_ALL=zh_CN.UTF-8 LANG=zh_CN.UTF-8 LANGUAGE=zh_CN.UTF-8 LC_MESSAGES=POSIX
dpkg-reconfigure -f noninteractive locales
# 设置环境变量
export LC_ALL=zh_CN.UTF-8 LANG=zh_CN.UTF-8 LANGUAGE=zh_CN.UTF-8
```
更新成功后,可使用`locale`命令查看字符编码信息。
## 更新记录
- 12、bookworm
----
本文原始来源 [Endial Fang](https://gitee.com/colovu) @ [Gitee.com](https://gitee.com)
Executable
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
# Ver: 3.0 by Endial Fang (endial@126.com)
#
# Docker 镜像构建脚本 - 主入口
# 编译后镜像名称
export IMAGE_NAME="debian"
# 依赖镜像的仓库地址(本镜像需要依赖原生 debian 镜像)
export REGISTRY_URL="swr.cn-north-4.myhuaweicloud.com/img-sync/docker.io/"
# 源仓库地址(本地编译时,使用阿里云源仓库)
export APT_SOURCE="aliyun"
# 针对无法直接下载到软件包,本地变异时,使用缓存的软件包
export LOCAL_URL="http://pkgs.colovu.com/dist"
# 引入本地构建脚本
if [ -f ".ci/common/build_local.sh" ]; then
# 执行本地构建脚本并传递参数
exec ".ci/common/build_local.sh" "$@"
else
echo "Error: .ci/common/build_local.sh script not found!"
exit 1
fi
+13
View File
@@ -0,0 +1,13 @@
Types: deb
# http://snapshot.debian.org/archive/debian/20230703T000000Z
URIs: http://mirrors.aliyun.com/debian
Suites: bookworm bookworm-updates
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Types: deb
# http://snapshot.debian.org/archive/debian-security/20230703T000000Z
URIs: http://mirrors.aliyun.com/debian-security
Suites: bookworm-security
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
+13
View File
@@ -0,0 +1,13 @@
Types: deb
# http://snapshot.debian.org/archive/debian/20230703T000000Z
URIs: http://deb.debian.org/debian
Suites: bookworm bookworm-updates
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Types: deb
# http://snapshot.debian.org/archive/debian-security/20230703T000000Z
URIs: http://deb.debian.org/debian-security
Suites: bookworm-security
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
+13
View File
@@ -0,0 +1,13 @@
Types: deb
# http://snapshot.debian.org/archive/debian/20230703T000000Z
URIs: http://mirrors.ustc.edu.cn/debian
Suites: bookworm bookworm-updates
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Types: deb
# http://snapshot.debian.org/archive/debian-security/20230703T000000Z
URIs: http://mirrors.ustc.edu.cn/debian-security
Suites: bookworm-security
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg