一个基于 SagerNet/sing-box 官方源码自动构建的多平台 Docker 镜像。
官方文档: https://sing-box.sagernet.org
镜像同时推送到 Docker Hub 和 GitHub Container Registry (GHCR)。
-
Docker Hub:
docker pull superng6/singbox -
GHCR.io:
docker pull ghcr.io/superng6/singbox
本仓库根据上游官方 Release 自动构建并维护两个主要标签:
-
latest&version tag(如v1.10.0) 稳定版 SagerNet/sing-box 的最新稳定版 (Stable Release),推荐生产环境使用。 -
dev&version tag(如v1.12.0-rc.1) 开发版 (Pre-release),包含最新功能,适合测试和尝鲜。
with_gvisor, with_quic, with_dhcp, with_wireguard, with_utls, with_acme, with_clash_api, with_tailscale
通过 GitHub Actions 自动构建,支持以下架构:
linux/amd64linux/arm64(arm64/v8)linux/arm/v7linux/ppc64lelinux/s390x
- 使用多阶段构建,第一阶段基于
golang:1.24(Debian12) 进行编译,支持多种cpu架构。 - 运行阶段基于
gcr.io/distroless/static-debian12:latest,安全无 Shell。
/etc/sing-box/config.json配置文件位置。- 你可以将 GeoIP、GeoSite 等数据文件放入
/etc/sing-box/,并在配置中引用。 - 挂载覆盖
/etc/sing-box目录,实现灵活配置管理。
以下示例展示如何在支持 TUN 设备的模式下运行 sing-box。
Docker Hub 镜像示例:
services:
sing-box:
image: superng6/singbox:latest
container_name: sing-box
restart: unless-stopped
network_mode: host
volumes:
- ./config.json:/etc/sing-box/config.json
cap_add:
- NET_ADMIN
devices:
- /dev/net/tunGHCR 镜像示例:
services:
sing-box:
image: ghcr.io/superng6/singbox:latest
container_name: sing-box
restart: unless-stopped
network_mode: host
volumes:
- ./config.json:/etc/sing-box/config.json
cap_add:
- NET_ADMIN
devices:
- /dev/net/tunDocker Hub:
docker run -d \
--name sing-box \
--network host \
--restart unless-stopped \
-v ./config.json:/etc/sing-box/config.json \
--cap-add NET_ADMIN \
--device /dev/net/tun \
superng6/singbox:latestGHCR:
docker run -d \
--name sing-box \
--network host \
--restart unless-stopped \
-v ./config.json:/etc/sing-box/config.json \
--cap-add NET_ADMIN \
--device /dev/net/tun \
ghcr.io/superng6/singbox:latest所有镜像通过 GitHub Actions 自动构建,保证镜像纯净且及时更新。 构建状态查看:GitHub Actions
Copyright (C) 2023 by nekohasekai <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.