A docker image to create ZeroTier moon in one setp.
Modified from: rwv/zerotier, supported architecture: linux/amd64,linux/ppc64le,linux/s390x,linux/arm64,linux/arm/v7,linux/arm64/v8.
docker run --name zerotier-moon -d --restart always -p 9993:9993/udp -v ~/somewhere:/var/lib/zerotier-one jongsx/zerotier-moon -4 1.2.3.4
Replace 1.2.3.4
with your moon's IPv4 address and replace ~/somewhere
with where you would like to store your configuration.
docker logs zerotier-moon
docker-compose.yml
example:
version: "3"
services:
zerotier-moon:
image: jongsx/zerotier-moon
container_name: "zerotier-moon"
restart: always
ports:
- "9993:9993/udp"
volumes:
- ./config:/var/lib/zerotier-one
entrypoint:
- /startup.sh
- "-4"
- 1.2.3.4
Replace 1.2.3.4
with your moon's IPv4 address.
docker-compose logs
docker exec zerotier-moon zerotier-cli
docker run --name zerotier-moon -d -p 9993:9993/udp -v ~/somewhere:/var/lib/zerotier-one jongsx/zerotier-moon -4 1.2.3.4
When creating a new container without mounting ZeroTier conf folder, a new moon id will be generated. This command will mount ~/somewhere
to /var/lib/zerotier-one
inside the container, allowing your ZeroTier moon to presist the same moon id. If you don't do this, when you start a new container, a new moon id will be generated.
docker run --name zerotier-moon -d -p 9993:9993/udp seedgou/zerotier-moon -4 1.2.3.4 -6 2001:abcd:abcd::1
Replace 1.2.3.4
, 2001:abcd:abcd::1
with your moon's IP. You can remove -4
option in pure IPv6 environment.
docker run --name zerotier-moon -d -p 9994:9993/udp jongsx/zerotier-moon -4 1.2.3.4 -p 9994
Replace 9994 with your own custom port for ZeroTier moon.
If you encounter issue: ERROR: unable to configure virtual network port: could not open TUN/TAP device: No such file or directory
, please add --cap-add=NET_ADMIN --cap-add=SYS_ADMIN --device=/dev/net/tun
args. Similar to this:
docker run --cap-add=NET_ADMIN --cap-add=SYS_ADMIN --device=/dev/net/tun --name zerotier-moon -d --restart always -p 9993:9993/udp jongsx/zerotier-moon -4 1.2.3.4
Solution provided by Jonnyan404's Fork. See Also Issue #1.
This image supports linux/amd64
, linux/ppc64le
, linux/arm64
, linux/arm/v7
, linux/arm64/v8
and linux/s390x
.