mirror of
https://github.com/dangeroustech/ZeroTierBridge.git
synced 2025-12-06 00:56:58 +00:00
chore: harden compose + entrypoint; docs refresh; ignore artifacts; dependabot
- docker-compose.yml.example: drop privileged; add cap_add (NET_ADMIN, NET_RAW) and sysctls; quote env vars - entrypoint.sh: add strict mode + traps; wait for service; idempotent iptables; graceful shutdown - README.md: update to multi-arch + non-privileged run guidance; fix examples - .gitignore: ignore sbom.spdx.json and results.sarif - .github/dependabot.yml: monitor Dockerfiles weekly No functional changes intended; improves security, robustness, and maintainability.
This commit is contained in:
14
README.md
14
README.md
@@ -20,21 +20,21 @@ You also need to add a static route into ZeroTier so that the traffic is routed
|
||||
|
||||
### Docker Compose
|
||||
|
||||
**You need to edit the `ZT_NETWORKS` and `ARCH` variable in the `docker-compose.yml` file first to add your networks and make sure your acrhitecture is correct (see [this page](http://download.zerotier.com/debian/buster/pool/main/z/zerotier-one/) for examples, usually either amd64 or arm64)**
|
||||
Edit the `ZT_NETWORKS` variable in `docker-compose.yml` to add your networks. Multi-arch images are published automatically; no architecture changes are needed.
|
||||
|
||||
Easiest way to bring up is via Docker Compose. Rename `docker-compose.yml.example` to `docker-compose.yml` and run `docker compose up -d`.
|
||||
|
||||
If you want to disable bridging, set `ZT_BRIDGE=false`. This can be done after the initial networks have been joined (just change the environment variable in the `docker-compose.yml` file and run `), as the ZeroTier config persists but IPTables forwarding is done on each container startup.
|
||||
If you want to disable bridging, set `ZT_BRIDGE=false`. This can be done after the initial networks have been joined (just change the environment variable in the `docker-compose.yml` file and restart), as the ZeroTier config persists but IPTables forwarding is done on each container startup.
|
||||
|
||||
### OG Docker
|
||||
|
||||
`docker build -t zerotierbridge .`
|
||||
|
||||
`docker run --privileged -e ZT_NETWORKS=NETWORK_1 NETWORK_2 -e ZT_BRIDGE=true zerotierbridge:latest`
|
||||
`docker run --cap-add NET_ADMIN --cap-add NET_RAW --sysctl net.ipv4.ip_forward=1 -e ZT_NETWORKS="NETWORK_1 NETWORK_2" -e ZT_BRIDGE=true zerotierbridge:latest`
|
||||
|
||||
Add your network ID(s) into the `ZT_NETWORKS` argument, space separated.
|
||||
|
||||
Disable bridging by passing `ZT_BRIDGE=false`. This can be done after the initial networks have been joined (just rebuild the container), as the ZeroTier config persists but IPTables forwarding is done on each container startup.
|
||||
Disable bridging by passing `ZT_BRIDGE=false`. This can be done after the initial networks have been joined (just restart the container), as the ZeroTier config persists but IPTables forwarding is done on each container startup.
|
||||
|
||||
#### Persistent Storage
|
||||
|
||||
@@ -42,8 +42,6 @@ If you would like the container to retain the same ZeroTier client ID on reboot,
|
||||
|
||||
`docker run --privileged -e ZT_NETWORKS=NETWORK_ID_HERE ZT_BRIDGE=true -v zt_config:/var/lib/zerotier-one/ zerotierbridge:latest`
|
||||
|
||||
#### Caveat: Architecture
|
||||
#### Notes
|
||||
|
||||
If you need to run this on a device with different architecture (a raspberry pi, for instance), then just edit line 3 of the Dockerfile.
|
||||
|
||||
If you were using a Raspberry Pi 4, you would change this to `ARCH=arm64` and the container will pull the correct ZeroTier installer.
|
||||
If your host requires additional privileges for networking, you may need to add device and capabilities in your runtime configuration. The provided Docker Compose example includes `cap_add: [NET_ADMIN, NET_RAW]` and `sysctls` for IP forwarding.
|
||||
|
||||
Reference in New Issue
Block a user