File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- FROM node:lts
1+ FROM node:lts-alpine3.19
22
33ARG LLONEBOT_VERSION
44
55RUN 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
1225WORKDIR /app/llonebot
1326
Original file line number Diff line number Diff line change 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 .
Original file line number Diff line number Diff line change @@ -3,21 +3,14 @@ FROM node:lts-alpine
33ARG LLONEBOT_VERSION
44
55RUN 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
2316RUN apk add unzip
You can’t perform that action at this time.
0 commit comments