peyman29/sing-box

By peyman29

Updated 8 months ago

Sing-Box Docker Image by Peyman

Image
Networking

185

Sing-Box Docker Image by Peyman

Ptechgithub

Sing-Box is a versatile platform designed for building proxies that efficiently bypass network restrictions, enhancing your online privacy and security.

The Docker images facilitate rapid deployment across various cloud computing environments.

For more information on Docker and containerization technologies, refer to official documentation.

Supported Tags
  • latest
  • 1.9.3
Reference

Supported Architectures:

  • amd64
  • arm64
  • armv7
  • s390x
  • i386
Prepare the Host

If you need to install Docker, please follow the official installation guide.

Pull the Image
$ docker pull peyman29/sing-box

This command pulls the latest release of Sing-Box, available on Docker Hub.


Feel free to add any specific details or modify version numbers as needed.

Start a container

You must create a configuration file /etc/sing-box/config.json in host at first:

mkdir -p /etc/sing-box

A sample in JSON like below:

{
  "log": {
    "level": "info",
    "timestamp": true
  },
  "inbounds": [
    {
      "type": "vmess",
      "tag": "vmess-in",
      "listen": "::",
      "listen_port": 9597,
      "sniff": true,
      "sniff_override_destination": true,
      "users": [
        {
          "name": "peyman",
          "uuid": "bf000d23-0752-40b4-affe-68f7707a9661"
        }
      ],
      "transport": {
        "type": "ws"
      }
    }
  ],
  "outbounds": [
    {
      "type": "direct",
      "tag": "direct"
    },
    {
      "type": "block",
      "tag": "block"
    }
  ],
  "route": {
    "geoip": {
      "path": "/usr/share/sing-box/geoip.db",
      "download_url": "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db",
      "download_detour": "direct"
    },
    "geosite": {
      "path": "/usr/share/sing-box/geosite.db",
      "download_url": "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db",
      "download_detour": "direct"
    },
    "rules": [
      {
        "network": "udp,tcp",
        "outbound": "direct"
      }
    ],
    "final": "direct",
    "auto_detect_interface": true
  }
}

There is an example to start a container that listen on port 9597, run as a Sing-Box server like below:

docker run -d -p 9597:9597 --name sing-box --restart=always -v /etc/sing-box:/etc/sing-box peyman29/sing-box

Warning: The port number must be same as configuration and opened in firewall.

Docker Pull Command

docker pull peyman29/sing-box