File tree Expand file tree Collapse file tree 1 file changed +9
-16
lines changed
Expand file tree Collapse file tree 1 file changed +9
-16
lines changed Original file line number Diff line number Diff line change 1- FROM golang:alpine AS builder
1+ FROM golang AS builder
22WORKDIR /app
33COPY . .
44ARG GITHUB_SHA
55ARG VERSION
6- RUN apk add --no-cache nodejs zstd && \
7- ARCH=$(uname -m) && \
8- case "$ARCH" in \
9- "x86_64" ) zstd -f /usr/bin/node -o assets/node_linux_amd64.zst ;; \
10- "aarch64" ) zstd -f /usr/bin/node -o assets/node_linux_arm64.zst ;; \
11- "armv7l" ) zstd -f /usr/bin/node -o assets/node_linux_armv7.zst ;; \
12- *) echo "不支持的架构: $ARCH" && exit 1 ;; \
13- esac
146RUN echo "Building commit: ${GITHUB_SHA:0:7}" && \
157 go mod tidy && \
168 go build -ldflags="-s -w -X main.Version=${VERSION} -X main.CurrentCommit=${GITHUB_SHA:0:7}" -trimpath -o subs-check .
179
18- FROM alpine
19- ENV TZ=Asia/Shanghai
20- RUN apk add --no-cache alpine-conf ca-certificates nodejs &&\
21- /usr/sbin/setup-timezone -z Asia/Shanghai && \
22- apk del alpine-conf && \
23- rm -rf /var/cache/apk/* && \
24- rm -rf /usr/bin/node
10+ FROM ubuntu
11+ ENV DEBIAN_FRONTEND=noninteractive TZ=Asia/Shanghai
12+ RUN apt-get update && apt-get install -y --no-install-recommends \
13+ ca-certificates tzdata && \
14+ ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \
15+ echo $TZ > /etc/timezone && \
16+ dpkg-reconfigure -f noninteractive tzdata && \
17+ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*
2518COPY --from=builder /app/subs-check /app/subs-check
2619CMD /app/subs-check
2720EXPOSE 8199
You can’t perform that action at this time.
0 commit comments