配置示例:
{
"log": {
"disabled": true,
"level": "error",
"output": "sing-box.log",
"timestamp": true
},
"experimental": {
"cache_file": {
"enabled": true,
"store_fakeip": true
},
"clash_api": {
"default_mode": "Rule",
"external_controller": "0.0.0.0:9090",
"external_ui": "ui",
"external_ui_download_url": "https://github.com/Zephyruso/zashboard/releases/latest/download/dist.zip",
"external_ui_download_detour": "Proxy"
}
},
"dns": {
"servers": [
{
"tag": "cloudflare",
"type": "https",
"server": "8.8.8.8",
"detour": "Proxy"
},
{
"tag": "ali",
"type": "https",
"server": "223.6.6.6"
},
{
"tag": "remote",
"type": "fakeip",
"inet4_range": "198.18.0.0/15",
"inet6_range": "fc00::/18"
}
],
"rules": [
{
"clash_mode": "Direct",
"action": "route",
"server": "ali"
},
{
"rule_set": [
"category-games@cn"
],
"action": "route",
"server": "ali"
},
{
"type": "logical",
"mode": "and",
"rules": [
{
"clash_mode": "AllowAds",
"invert": true
},
{
"rule_set": "AWAvenue-Ads"
}
],
"action": "reject"
},
{
"rule_set": [
"cn-domain"
],
"action": "route",
"server": "ali"
},
{
"query_type": [
"A",
"AAAA"
],
"action": "route",
"server": "remote"
}
],
"independent_cache": true,
"strategy": "prefer_ipv4"
},
"inbounds": [
{
"type": "mixed",
"tag": "mixed",
"listen": "::",
"listen_port": 7890,
"users": [
{
"username": "",
"password": ""
}
]
}
],
"outbounds": [
{
"tag": "direct",
"type": "direct"
},
{
"tag": "Proxy",
"type": "selector",
"outbounds": [
"direct"
],
"default": "direct",
"use_all_providers": true,
"interrupt_exist_connections": true
}
],
"providers": [
{
"tag": "Provider1",
"type": "remote",
"url": "//////////////??????",
"update_interval": "24h",
"path": "./Provider1.json"
}
],
"route": {
"default_domain_resolver": "ali",
"rule_set": [
{
"tag": "AWAvenue-Ads",
"type": "remote",
"url": "https://raw.githubusercontent.com/TG-Twilight/AWAvenue-Ads-Rule/main/Filters/AWAvenue-Ads-Rule-Singbox.json",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"tag": "category-games@cn",
"type": "remote",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/[email protected]",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"tag": "geolocation-!cn",
"type": "remote",
"url": "https://raw.githubusercontent.com/CHIZI-0618/v2ray-rules-dat/release/singbox_rule_set/geosite-geolocation-!cn.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"tag": "cn-domain",
"type": "remote",
"url": "https://raw.githubusercontent.com/CHIZI-0618/v2ray-rules-dat/release/singbox_rule_set/geosite-cn.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"tag": "cn-ip",
"type": "remote",
"url": "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geoip/cn.srs",
"download_detour": "Proxy",
"update_interval": "10d"
}
],
"rules": [
{
"action": "sniff"
},
{
"type": "logical",
"mode": "or",
"rules": [
{
"port": 53
},
{
"protocol": "dns"
}
],
"action": "hijack-dns"
},
{
"clash_mode": "Direct",
"action": "route",
"outbound": "direct"
},
{
"rule_set": [
"category-games@cn"
],
"action": "route",
"outbound": "direct"
},
{
"type": "logical",
"mode": "and",
"rules": [
{
"clash_mode": "AllowAds",
"invert": true
},
{
"rule_set": "AWAvenue-Ads"
}
],
"action": "reject"
},
{
"rule_set": [
"cn-domain"
],
"action": "route",
"outbound": "direct"
},
{
"rule_set": "cn-ip",
"action": "route",
"outbound": "direct"
},
{
"ip_is_private": true,
"outbound": "direct"
}
],
"find_process": true,
"auto_detect_interface": true,
"final": "Proxy"
}
}
compose: ↓↓↓ services: sing-box: image: woshi17/ref1nd-stable:latest restart: always container_name: sing-box network_mode: host volumes: - ./docker/sing-box:/root/docker/sing-box 按需修改 # 必须添加下面这一行来指定启动命令和配置文件路径 command: run -c /root/docker/sing-box/config.json 按需修改
一键命令: ↓↓↓↓ docker run -d --name sing-box --restart always --network host -v $(pwd)/docker/sing-box:/root/docker/sing-box woshi17/ref1nd-stable:latest run -c /root/docker/sing-box/config.json
更多特性参数: https://github.com/woshishiq1/sing-box/blob/stable/README.md
Content type
Image
Digest
sha256:c650446b5…
Size
40.2 MB
Last updated
about 16 hours ago
docker pull woshi17/ref1nd-stable