HuggingFace0920 commited on
Commit
11fe6e4
·
verified ·
1 Parent(s): 784c720

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -8
Dockerfile CHANGED
@@ -1,14 +1,26 @@
1
- FROM alpine:3.20
 
2
 
3
- RUN apk add --no-cache ca-certificates tzdata curl gcompat
 
 
4
 
5
- ENV TZ=Asia/Shanghai
6
- RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
 
 
 
 
 
 
 
7
 
 
8
  WORKDIR /opt/openlist
9
- RUN curl -L -o openlist.tar.gz \
10
- https://github.com/OpenListTeam/OpenList/releases/download/beta/openlist-linux-amd64.tar.gz && \
11
- tar -xzf openlist.tar.gz && rm openlist.tar.gz && chmod +x openlist
 
12
 
13
  EXPOSE 8080
14
- CMD ["./openlist", "server"]
 
1
+ # ---------- Stage 1: 下载并解压(抛弃)----------
2
+ FROM debian:stable-slim AS fetcher
3
 
4
+ RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ ca-certificates curl tar && \
6
+ rm -rf /var/lib/apt/lists/*
7
 
8
+ WORKDIR /tmp
9
+ ARG OPENLIST_VERSION=beta
10
+ RUN curl -L -o openlist.tar.gz \
11
+ https://github.com/OpenListTeam/OpenList/releases/download/${OPENLIST_VERSION}/openlist-linux-amd64.tar.gz && \
12
+ tar -xzf openlist.tar.gz && \
13
+ chmod +x openlist
14
+
15
+ # ---------- Stage 2: 最终运行环境 ----------
16
+ FROM gcr.io/distroless/base-debian12
17
 
18
+ LABEL maintainer="[email protected]"
19
  WORKDIR /opt/openlist
20
+ COPY --from=fetcher /tmp/openlist /opt/openlist/openlist
21
+
22
+ # 时区:只需要告诉 glibc 使用哪个 tz,不必携带 tzdata 全表
23
+ ENV TZ=Asia/Shanghai
24
 
25
  EXPOSE 8080
26
+ ENTRYPOINT ["./openlist","server"]