-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (26 loc) · 977 Bytes
/
Dockerfile
File metadata and controls
41 lines (26 loc) · 977 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
37
38
39
40
41
FROM --platform=$TARGETPLATFORM alpine:latest AS builder
LABEL email="yourpipi@proton.me"
ARG SING_BOX_VERSION=1.4.1
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
ARG NAME=sing-box-${SING_BOX_VERSION}-${TARGETOS}-${TARGETARCH}${TARGETVARIANT}
ARG RELEASE_NAME=${NAME}.tar.gz
RUN set -ex \
&& apk update \
&& apk add wget \
&& wget https://github.com/SagerNet/sing-box/releases/download/v${SING_BOX_VERSION}/${RELEASE_NAME} -O ${RELEASE_NAME} \
&& tar -zxvf ${RELEASE_NAME} \
&& mv ./${NAME}/sing-box /usr/local/bin/sing-box
FROM --platform=$TARGETPLATFORM alpine:latest AS dist
COPY --from=builder /usr/local/bin/sing-box /usr/local/bin/
RUN set -ex \
&& chmod +x /usr/local/bin/sing-box \
&& apk update \
&& apk upgrade \
&& apk add bash tzdata ca-certificates \
&& rm -rf /var/cache/apk/*
VOLUME [ "/etc/sing-box/" ]
EXPOSE 2080
ENTRYPOINT [ "/usr/local/bin/sing-box" ]
CMD [ "run", "-c", "/etc/sing-box/config.json" ]