| ADD alpine-minirootfs-3.24.1-armv7.tar.gz / # buildkit |
| CMD ["/bin/sh"] |
| RUN /bin/sh -c apk add --no-cache ca-certificates curl iproute2 iptables nftables tzdata && update-ca-certificates # buildkit |
| ARG TARGETPLATFORM=linux/arm/v7 |
| ARG SING_BOX_VERSION=1.12.17 |
| RUN |2 TARGETPLATFORM=linux/arm/v7 SING_BOX_VERSION=1.12.17 /bin/sh -c ARCH=$(case ${TARGETPLATFORM} in "linux/amd64") echo "amd64" ;; "linux/arm64") echo "arm64" ;; "linux/arm/v7") echo "armv7" ;; "linux/arm/v6") echo "armv6" ;; "linux/386") echo "386" ;; "linux/mips64") echo "mips64" ;; "linux/mips64le") echo "mips64le" ;; "linux/mips") echo "mips" ;; "linux/mipsle") echo "mipsle" ;; "linux/ppc64le") echo "ppc64le" ;; "linux/riscv64") echo "riscv64" ;; "linux/s390x") echo "s390x" ;; *) echo "amd64" ;; esac) && echo "Downloading sing-box for ${ARCH}..." && wget -q -O /tmp/sing-box.tar.gz "https://github.com/SagerNet/sing-box/releases/download/v${SING_BOX_VERSION}/sing-box-${SING_BOX_VERSION}-linux-${ARCH}.tar.gz" && tar -xzf /tmp/sing-box.tar.gz -C /tmp && mv /tmp/sing-box-${SING_BOX_VERSION}-linux-${ARCH}/sing-box /usr/local/bin/sing-box && chmod +x /usr/local/bin/sing-box && rm -rf /tmp/sing-box* && sing-box version # buildkit |
| COPY /build/vpn-converter /usr/local/bin/vpn-converter # buildkit |
| WORKDIR /app |
| COPY entrypoint.sh /entrypoint.sh # buildkit |
| RUN |2 TARGETPLATFORM=linux/arm/v7 SING_BOX_VERSION=1.12.17 /bin/sh -c chmod +x /entrypoint.sh # buildkit |
| RUN |2 TARGETPLATFORM=linux/arm/v7 SING_BOX_VERSION=1.12.17 /bin/sh -c mkdir -p /etc/sing-box # buildkit |
| RUN |2 TARGETPLATFORM=linux/arm/v7 SING_BOX_VERSION=1.12.17 /bin/sh -c mkdir -p /dev/net && mknod /dev/net/tun c 10 200 && chmod 666 /dev/net/tun # buildkit |
| EXPOSE [10808/tcp] |
| LABEL maintainer=Mehrdad Amini <[email protected]> |
| LABEL description=sing-box TUN Gateway - Multi-Architecture VPN Gateway |
| LABEL org.opencontainers.image.title=singbox-tun-gateway |
| LABEL org.opencontainers.image.description=Multi-architecture VPN gateway using sing-box with TUN mode |
| LABEL org.opencontainers.image.authors=Mehrdad Amini <[email protected]> |
| ENTRYPOINT ["/entrypoint.sh"] |
| CMD ["sing-box" "run" "-c" "/etc/sing-box/config.json"] |