forked from yujincheng08/rust-iptv-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 953 Bytes
/
Dockerfile
File metadata and controls
36 lines (27 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM alpine:latest AS builder
# 仅在构建阶段安装下载和解压工具
RUN apk add --no-cache curl unzip
WORKDIR /app
ARG TARGETARCH
ARG VERSION
RUN set -ex; \
if [ "$TARGETARCH" = "amd64" ]; then \
FILE_NAME="x86_64-unknown-linux-musl.zip"; \
elif [ "$TARGETARCH" = "arm64" ]; then \
FILE_NAME="aarch64-unknown-linux-musl.zip"; \
fi; \
\
URL="https://github.com/yujincheng08/rust-iptv-proxy/releases/download/${VERSION}/${FILE_NAME}"; \
\
curl -L -f -o "package.zip" "${URL}" && \
unzip "package.zip" && \
# 找到二进制文件并重命名/移动到固定位置,方便下一阶段拷贝
mv iptv /app/iptv_bin
FROM alpine:latest
# 只保留程序运行必不可少的运行时库
RUN apk add --no-cache ca-certificates libgcc libstdc++
WORKDIR /app
COPY --from=builder --chmod=755 /app/iptv_bin ./iptv
EXPOSE 7878
ENTRYPOINT ["./iptv", "--bind", "0.0.0.0:7878"]
CMD ["--help"]