Open pablofrommars opened 2 years ago
i have not tried that before but i would play with iptables on the host to forward packages between the docker network and the zt interface
i guess that's possible now with the -router
tag of this container, you can simply create a container network and have one zerotier container as a gateway routing only into this virtual network
Rather than open a new issue, I'll just mention here that the main page on DockerHub probably needs updating too.
true, i will update it
I have taken a slightly different approach.
--net=host
so the container gets isolated inside of its own network9993
to avoid collisions if running multiple instances.
Add volume ./zerotier_config:/var/lib/zerotier-one
and inside of it create file local.conf
and add:
{
"settings": {
"primaryPort": 9997
}
}
network_mode: container:zerotier_container_name
(this step can differ)
This way you can have multiple ZT containers running with access to different networks without exposing these networks to the host.@PovilasID cheers.
---
version: "3.8"
services:
arma-reforger:
image: ghcr.io/acemod/arma-reforger:latest
platform: linux/amd64
# left here for posterity
# ports:
# - "2001:2001/udp"
# - "17777:17777/udp"
# - "19999:19999/udp"
volumes:
- ./reforger/configs:/reforger/Configs
- ./reforger/profile:/home/profile
- ./reforger/workshop:/reforger/workshop
environment:
- ARMA_CONFIG
- SERVER_PUBLIC_ADDRESS
network_mode: service:zerotier
zerotier:
image: zyclonite/zerotier:latest
cap_add:
- NET_ADMIN
- SYS_ADMIN
devices:
- /dev/net/tun
volumes:
- ./zerotier:/var/lib/zerotier-one
preparation zerotier:
./zerotier/networks.d/YOUR_NETWORK_ID.conf
./zerotier/local.conf
with content{
"settings": {
"primaryPort": 9997
}
}
docker compose run zerotier
preparation arma reforger
#4
Save
(note the saved file) as ARMA_CONFIG./reforger/configs/
start:
Thanks for your work, this has been very valuable already.
Apologies if this is off topic as it is more a question than an actual issue. I would like to be able to create an isolated network for multiple containers running on the same host along side zerotier-docker. Basically sharing the interface created by your image to a group of containers. Is this a use case you have experimented with before?