Skip to content

Commit d948d63

Browse files
committed
ci(docker): fix
1 parent 51baf74 commit d948d63

3 files changed

Lines changed: 18 additions & 11 deletions

File tree

docker/Dockerfile

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1-
FROM node:lts
1+
FROM node:lts-alpine3.19
22

33
ARG LLONEBOT_VERSION
44

55
RUN set -eux; \
6-
apt update; \
7-
apt install -y tzdata ffmpeg unzip wget; \
6+
# 获取当前系统 Alpine 主要版本 (如 3.19)
7+
ALPINE_VERSION=$(cut -d '.' -f1,2 /etc/alpine-release); \
8+
# 检查版本号是否有效
9+
[ -n "$ALPINE_VERSION" ] || { echo "Error: Failed to get Alpine version"; exit 1; }; \
10+
# 配置阿里云镜像源
11+
echo "https://mirrors.aliyun.com/alpine/v$ALPINE_VERSION/main" > /etc/apk/repositories; \
12+
echo "https://mirrors.aliyun.com/alpine/v$ALPINE_VERSION/community" >> /etc/apk/repositories; \
13+
# 更新索引
14+
apk update; \
15+
# 安装时区工具
16+
apk add --no-cache tzdata ffmpeg; \
17+
# 设置时区为上海
818
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime; \
919
echo "Asia/Shanghai" > /etc/timezone; \
10-
rm -rf /var/lib/apt/lists/*
20+
# 清理缓存减少镜像体积
21+
rm -rf /var/cache/apk/*
22+
23+
RUN apk add unzip wget
1124

1225
WORKDIR /app/llonebot
1326

docker/build.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker buildx build --progress=plain --build-arg LLONEBOT_VERSION=7.0.0 --platform linux/amd64,linux/arm64 -t linyuchen/llonebot:7.0.0 -f docker/Dockerfile .

docker/debug.Dockerfile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,14 @@ FROM node:lts-alpine
33
ARG LLONEBOT_VERSION
44

55
RUN set -eux; \
6-
# 获取当前系统 Alpine 主要版本 (如 3.19)
76
ALPINE_VERSION=$(grep -oE '[0-9]+\.[0-9]+' /etc/alpine-release); \
8-
# 检查版本号是否有效
97
[ -n "$ALPINE_VERSION" ] || { echo "Error: Failed to get Alpine version"; exit 1; }; \
10-
# 配置阿里云镜像源
118
echo "https://mirrors.aliyun.com/alpine/v$ALPINE_VERSION/main" > /etc/apk/repositories; \
129
echo "https://mirrors.aliyun.com/alpine/v$ALPINE_VERSION/community" >> /etc/apk/repositories; \
13-
# 更新索引
1410
apk update; \
15-
# 安装时区工具
1611
apk add --no-cache tzdata ffmpeg; \
17-
# 设置时区为上海
1812
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime; \
1913
echo "Asia/Shanghai" > /etc/timezone; \
20-
# 清理缓存减少镜像体积
2114
rm -rf /var/cache/apk/*
2215

2316
RUN apk add unzip

0 commit comments

Comments
 (0)