-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
meta.Dockerfile
51 lines (42 loc) · 1.11 KB
/
meta.Dockerfile
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
42
43
44
45
46
47
48
49
50
51
FROM alpine:3.19.1
WORKDIR /root
ARG CLASH_VERSION=v1.18.3
ARG TARGETPLATFORM
ENV TZ=Asia/Shanghai
RUN <<EOF
sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
apk update
apk add --no-cache bash curl gzip
rm -rf /var/cache/apk/*
EOF
RUN <<EOF
echo "TARGETPLATFORM=$TARGETPLATFORM"
case "$TARGETPLATFORM" in
linux/amd64)
meta_type=amd64
tini_type=amd64
;;
linux/arm64)
meta_type=arm64
tini_type=arm64
;;
linux/arm/v*)
meta_type=armv7
tini_type=armhf
;;
*)
meta_type=unknown-arch
tini_type=unknown-arch
;;
esac
curl -Lfo /tini "https://mirror.ghproxy.com/https://github.com/krallin/tini/releases/latest/download/tini-static-$tini_type"
chmod +x /tini
curl -Lfo ./clash.gz "https://mirror.ghproxy.com/https://github.com/MetaCubeX/mihomo/releases/latest/download/mihomo-linux-$meta_type-$CLASH_VERSION.gz"
gunzip ./clash.gz
rm -f ./clash.gz
chmod +x ./clash
EOF
LABEL maintainer="ADoyle <[email protected]>"
LABEL description="The clash meta"
ENTRYPOINT ["/tini", "--"]
CMD ["/root/clash"]