mirror of
https://github.com/certd/certd.git
synced 2026-07-02 01:17:32 +08:00
docs(ci): add slim docker image support and update all documentations
1. 新增slim镜像版本的文档说明,补充镜像版本选择指南 2. 更新docker-compose示例注释,将arm适配改为slim镜像适配 3. 重构README、镜像说明文档的镜像表格排版 4. 调整CI构建脚本,将alpine构建改为slim构建,修正Dockerfile构建逻辑 5. 统一镜像标签命名,移除-alpine后缀改为-slim
This commit is contained in:
+8
-15
@@ -1,4 +1,4 @@
|
||||
ARG base_type=slim
|
||||
ARG base_type=alpine
|
||||
|
||||
# 根据 base_type 参数选择基础镜像系列
|
||||
FROM --platform=linux/amd64 node:22-alpine AS base-amd64-alpine
|
||||
@@ -21,17 +21,16 @@ RUN cp /workspace/certd-client/dist/* /workspace/certd-server/public/ -rf
|
||||
RUN cd /workspace/certd-server && pnpm install --production && npm run build-on-docker
|
||||
|
||||
|
||||
ARG base_type=slim
|
||||
ARG base_type=alpine
|
||||
|
||||
FROM base-${TARGETARCH}${TARGETVARIANT:+-}${TARGETVARIANT}-${base_type}
|
||||
EXPOSE 7001
|
||||
EXPOSE 7002
|
||||
|
||||
ARG base_type=slim
|
||||
ARG base_type=alpine
|
||||
|
||||
# 根据基础镜像发行版选择包管理器
|
||||
# trixie-slim -> apt-get, alpine -> apk
|
||||
# base_type=alpine 时不安装 openjdk
|
||||
RUN if [ -f /etc/debian_version ]; then \
|
||||
apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
@@ -43,20 +42,14 @@ RUN if [ -f /etc/debian_version ]; then \
|
||||
iputils-ping \
|
||||
dnsutils \
|
||||
iproute2 \
|
||||
&& if [ "$base_type" != "alpine" ]; then \
|
||||
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | tee /usr/share/keyrings/adoptium.gpg > /dev/null \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/adoptium.gpg] https://packages.adoptium.net/artifactory/deb bookworm main" | tee /etc/apt/sources.list.d/adoptium.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends temurin-8-jre; \
|
||||
fi \
|
||||
&& wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | tee /usr/share/keyrings/adoptium.gpg > /dev/null \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/adoptium.gpg] https://packages.adoptium.net/artifactory/deb bookworm main" | tee /etc/apt/sources.list.d/adoptium.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends temurin-8-jre \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*; \
|
||||
elif [ -f /etc/alpine-release ]; then \
|
||||
if [ "$base_type" = "alpine" ]; then \
|
||||
apk add --no-cache openssl; \
|
||||
else \
|
||||
apk add --no-cache openssl openjdk8-jre; \
|
||||
fi; \
|
||||
apk add --no-cache openssl openjdk8-jre; \
|
||||
else \
|
||||
echo "Unsupported base image"; exit 1; \
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user