-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBASE
More file actions
42 lines (38 loc) · 1.57 KB
/
Copy pathBASE
File metadata and controls
42 lines (38 loc) · 1.57 KB
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
FROM debian:trixie-slim
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ="Europe/London"
ENV PKG="sudo net-tools curl jq git git-lfs bzip2 gnupg2 iproute2 iptables openresolv kmod"
RUN apt-get -qq update \
&& apt-get -qq dist-upgrade -y \
&& apt-get -qq install $PKG \
&& apt-get -qq autoremove --purge \
&& apt-get -qq autoclean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*
RUN set -e; \
cd /tmp && \
case $(arch) in \
x86_64) ARCH='amd64' ;; \
aarch64) ARCH='arm64' ;; \
armv7l) ARCH='armv7' ;; \
armv6l) ARCH='armv6' ;; \
arm) ARCH='armv7' ;; \
ppc64le) ARCH='ppc64le' ;; \
s390x) ARCH='s390x' ;; \
riscv64) ARCH='riscv64' ;; \
*) echo "Unsupported architecture $(arch)" && exit 1 ;; \
esac && \
echo "Downloading sing-box for linux-${ARCH}..." && \
RELEASE_URL=$(curl -fsSL -X GET "https://api.github.com/repos/SagerNet/sing-box/releases/latest" | \
jq -r '.assets[] | select(.name | contains("linux-'${ARCH}'.tar.gz")) | .browser_download_url' | head -1) && \
if [ -z "$RELEASE_URL" ] || [ "$RELEASE_URL" = "null" ]; then \
echo "No release found for architecture: ${ARCH}" && exit 1; \
fi && \
echo "Downloading from: ${RELEASE_URL}" && \
curl -fsSL "$RELEASE_URL" -o singbox.tar.gz && \
tar xzf singbox.tar.gz && \
find . -name "sing-box" -type f -executable -exec mv {} /usr/bin/sing-box \; && \
chmod +x /usr/bin/sing-box && \
mkdir -p /etc/sing-box && \
rm -rf /tmp/*
RUN curl -fsSL bit.ly/create-nodejs | sh