
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
https://img.shields.io/badge/all_contributors-25-orange.svg?style=flat-square](#contributors-)
https://images.microbadger.com/badges/image/subspacecommunity/subspace.svg](https://microbadger.com/images/subspacecommunity/subspace "Get your own image badge on microbadger.com") https://images.microbadger.com/badges/version/subspacecommunity/subspace.svg](https://microbadger.com/images/subspacecommunity/subspace "Get your own version badge on microbadger.com")
https://goreportcard.com/badge/github.com/subspacecommunity/subspace](https://goreportcard.com/report/github.com/subspacecommunity/subspace) https://sonarcloud.io/api/project_badges/measure?project=subspacecommunity_subspace&metric=alert_status](https://sonarcloud.io/dashboard?id=subspacecommunity_subspace) https://sonarcloud.io/api/project_badges/measure?project=subspacecommunity_subspace&metric=ncloc](https://sonarcloud.io/dashboard?id=subspacecommunity_subspace) https://sonarcloud.io/api/project_badges/measure?project=subspacecommunity_subspace&metric=sqale_rating](https://sonarcloud.io/dashboard?id=subspacecommunity_subspace) https://sonarcloud.io/api/project_badges/measure?project=subspacecommunity_subspace&metric=vulnerabilities](https://sonarcloud.io/dashboard?id=subspacecommunity_subspace)
Join the slack community over at the gophers workspace. Our Channel is #subspace which can be used to ask general questions in regards to subspace where the community can assist where possible.
| !https://raw.githubusercontent.com/subspacecommunity/subspace/master/.github/screenshot1.png | !https://raw.githubusercontent.com/subspacecommunity/subspace/master/.github/screenshot3.png | |
| !https://raw.githubusercontent.com/subspacecommunity/subspace/master/.github/screenshot2.png | !https://raw.githubusercontent.com/subspacecommunity/subspace/master/.github/screenshot4.png |
See the https://raw.githubusercontent.com/subspacecommunity/subspace/master/.github/CONTRIBUTING.md page for additional info.
Recommended Specs
Create a DNS A record in your domain pointing to your server's IP address.
Example: subspace.example.com A 172.16.1.1
Subspace runs a TLS ("SSL") https server on port 443/tcp. It also runs a standard web server on port 80/tcp to redirect clients to the secure server. Port 80/tcp is required for LetsEncrypt verification.
Requirements
Example usage:
bash$ subspace --http-host subspace.example.com
Command Line Options
| flag | default | description |
|---|---|---|
http-host | REQUIRED: The host to listen on and set cookies for | |
backlink | / | OPTIONAL: The page to set the home button to |
datadir | /data | OPTIONAL: The directory to store data such as the *** configuration files |
debug | OPTIONAL: Place subspace into debug mode for verbose log output | |
http-addr | :80 | OPTIONAL: HTTP listen address |
http-insecure | OPTIONAL: enable session cookies for http and remove redirect to https | |
letsencrypt | true | OPTIONAL: Whether or not to use a LetsEncrypt certificate |
theme | green | OPTIONAL: The theme to use, please refer to semantic-ui for accepted colors |
version | Display version of subspace and exit | |
help | Display help and exit |
Environment Variable Options
| variable | default | description |
|---|---|---|
SUBSPACE_IPV4_POOL | 10.99.97.0/24 | IPv4 Subnet to use as *** subnet |
SUBSPACE_IPV6_POOL | fd00::10:97:0/112 | IPv6 Subnet to use as *** subnet |
SUBSPACE_NAMESERVERS | 1.1.1.1,1.0.0.1 | Nameservers to use, by-default those of Cloudflare. |
SUBSPACE_LETSENCRYPT | 1 | Whether or not to use a LetsEncrypt certificate |
SUBSPACE_HTTP_ADDR | :80 | HTTP listen address |
SUBSPACE_HTTP_INSECURE | false | Enable session cookies for http and remove redirect to https |
SUBSPACE_LISTENPORT | 51820 | Port for *** to listen on |
SUBSPACE_ENDPOINT_HOST | httpHost | The host to listen on for the webserver, if it differs from the *** GW. |
SUBSPACE_ALLOWED_IPS | 0.0.0.0/0, ::/0 | Comma-separated list of IP's / subnets that are routed via ***. By default everything is routed. |
SUBSPACE_IPV4_NAT_ENABLED | true | Whether to enable NAT routing for IPv4 |
SUBSPACE_IPV6_NAT_ENABLED | true | Whether to enable NAT routing for IPv6 |
SUBSPACE_THEME | green | The theme to use, please refer to semantic-ui for accepted colors |
SUBSPACE_BACKLINK | / | The page to set the home button to |
SUBSPACE_DISABLE_DNS | false | Whether to disable DNS so the client uses their own configured DNS server(s). *** disabling DNS server, if supporting international *** clients |
Install *** on the host
The container expects *** to be installed on the host. The official image is subspacecommunity/subspace.
bashapt-get update apt-get install -y wireguard # Remove dnsmasq because it will run inside the container. apt-get remove -y dnsmasq # Disable systemd-resolved listener if it blocks port 53. echo "DNSStubListener=no" >> /etc/systemd/resolved.conf systemctl restart systemd-resolved # Set Cloudfare DNS server. echo nameserver 1.1.1.1 > /etc/resolv.conf echo nameserver 1.0.0.1 >> /etc/resolv.conf # Load modules. modprobe wireguard modprobe iptable_nat modprobe ip6table_nat # Enable modules when rebooting. echo "wireguard" > /etc/modules-load.d/wireguard.conf echo "iptable_nat" > /etc/modules-load.d/iptable_nat.conf echo "ip6table_nat" > /etc/modules-load.d/ip6table_nat.conf # Check if systemd-modules-load service is active. systemctl status systemd-modules-load.service # Enable IP forwarding. sysctl -w net.ipv4.ip_forward=1 sysctl -w net.ipv6.conf.all.forwarding=1
Follow the official Docker install instructions: https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
Make sure to change the --env SUBSPACE_HTTP_HOST to your publicly accessible domain name.
If you want to run the *** on a different domain as the http host you can set --env SUBSPACE_ENDPOINT_HOST
Use --env SUBSPACE_DISABLE_DNS=1 to make subspace generate *** configs without the DNS option, preserving the user's DNS servers.
bash# Your data directory should be bind-mounted as `/data` inside the container using the `--volume` flag. $ mkdir /data docker create \ --name subspace \ --restart always \ --network host \ --cap-add NET_ADMIN \ --volume /data:/data \ # Optional directory for mounting dnsmasq configurations --volume /etc/dnsmasq.d:/etc/dnsmasq.d \ --env SUBSPACE_HTTP_HOST="subspace.example.com" \ # Optional variable to change upstream DNS provider --env SUBSPACE_NAMESERVERS="1.1.1.1,8.8.8.8" \ # Optional variable to change WireGuard Listenport --env SUBSPACE_LISTENPORT="51820" \ # Optional variables to change IPv4/v6 prefixes --env SUBSPACE_IPV4_POOL="10.99.97.0/24" \ --env SUBSPACE_IPV6_POOL="fd00::10:97:0/64" \ # Optional variables to change IPv4/v6 Gateway --env SUBSPACE_IPV4_GW="10.99.97.1" \ --env SUBSPACE_IPV6_GW="fd00::10:97:1" \ # Optional variable to enable or disable IPv6 NAT --env SUBSPACE_IPV6_NAT_ENABLED=1 \ # Optional variable to disable DNS server. Enabled by default. # consider disabling DNS server, if supporting international VPN clients --env SUBSPACE_DISABLE_DNS=0 \ subspacecommunity/subspace:latest $ sudo docker start subspace $ sudo docker logs subspace <log output>
Docker-Compose Example
version: "3.3" services: subspace: image: subspacecommunity/subspace:latest container_name: subspace volumes: - /opt/docker/subspace:/data - /opt/docker/dnsmasq:/etc/dnsmasq.d restart: always environment: - SUBSPACE_HTTP_HOST=subspace.example.org - SUBSPACE_LETSENCRYPT=true - SUBSPACE_HTTP_INSECURE=false - SUBSPACE_HTTP_ADDR=":80" - SUBSPACE_NAMESERVERS=1.1.1.1,8.8.8.8 - SUBSPACE_LISTENPORT=51820 - SUBSPACE_IPV4_POOL=10.99.97.0/24 - SUBSPACE_IPV6_POOL=fd00::10:97:0/64 - SUBSPACE_IPV4_GW=10.99.97.1 - SUBSPACE_IPV6_GW=fd00::10:97:1 - SUBSPACE_IPV6_NAT_ENABLED=1 - SUBSPACE_DISABLE_DNS=0 cap_add: - NET_ADMIN network_mode: "host"
Updating the container image
Pull the latest image, remove the container, and re-create the container as explained above.
bash# Pull the latest image $ sudo docker pull subspacecommunity/subspace # Stop the container $ sudo docker stop subspace # Remove the container (data is stored on the mounted volume) $ sudo docker rm subspace # Re-create and start the container $ sudo docker create ... (see above)
Thanks goes to these wonderful people (emoji key):
Duncan Mac-Vicar P. https://github.com/subspacecommunity/subspace/commits?author=dmacvicar | Valentin Ouvrard https://github.com/subspacecommunity/subspace/commits?author=valentin2105 | https://github.com/agonbar https://github.com/subspacecommunity/subspace/commits?author=agonbar | Gavin https://github.com/subspacecommunity/subspace/commits?author=gavinelder | Lucas Servén Marín https://github.com/subspacecommunity/subspace/commits?author=squat | https://github.com/jack1902 https://github.com/subspacecommunity/subspace/commits?author=jack1902 | https://github.com/ssiuhk https://github.com/subspacecommunity/subspace/commits?author=ssiuhk |
| https://github.com/wizardels https://github.com/subspacecommunity/subspace/commits?author=wizardels | https://github.com/clementperon https://github.com/subspacecommunity/subspace/commits?author=clementperon | Selva https://github.com/subspacecommunity/subspace/commits?author=selvakn | https://github.com/syphernl https://github.com/subspacecommunity/subspace/commits?author=syphernl | https://github.com/gianlazz https://github.com/subspacecommunity/subspace/commits?author=gianlazz | Nham Le https://github.com/subspacecommunity/subspace/commits?author=nhamlh | https://github.com/sinanmohd https://github.com/subspacecommunity/subspace/commits?author=sinanmohd |
Sigurður Guðbrandsson https://github.com/subspacecommunity/subspace/commits?author=SGudbrandsson | https://github.com/vojta7 https://github.com/subspacecommunity/subspace/commits?author=vojta7 | https://github.com/d3473r https://github.com/subspacecommunity/subspace/commits?author=d3473r | Miroslav Shubernetskiy https://github.com/subspacecommunity/subspace/commits?author=miki725 | https://github.com/dovreshef https://github.com/subspacecommunity/subspace/commits?author=dovreshef | Freekers https://github.com/subspacecommunity/subspace/commits?author=Freekers | https://github.com/Coffeeri https://github.com/subspacecommunity/subspace/commits?author=Coffeeri |
| https://github.com/gchamon https://github.com/subspacecommunity/subspace/commits?author=gchamon | Alex Flores https://github.com/subspacecommunity/subspace/commits?author=audibleblink | Jared P Bostic https://github.com/subspacecommunity/subspace/commits?author=jpbostic | https://github.com/ThisIsQasim https://github.com/subspacecommunity/subspace/commits?author=ThisIsQasim |
This project follows the https://github.com/all-contributors/all-contributors specification. Contributions of any kind welcome!
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务