Skip to main content How to integrate ZeroTier network and a docker container? : r/zerotier
r/zerotier icon
Go to zerotier

How to integrate ZeroTier network and a docker container?

Cloud & Docker

Hi everyone,

I am given a pre-built docker image to run on an Ubuntu VM, I was wondering if it is possible to get that container connected to a ZeroTier network?

Do I have to run ZeroTier within that same container where the docker image is being ran?

Sort by:
Best
Open comment sort options
Moderator Announcement Read More »
[deleted]

You only need to install ZT on the Ubuntu VM and then join it to your network.

Not necessary to try to run ZT on the same container the image is being ran in?

More replies
[deleted]

I think I understand now. You want to install ZT on the base host that docker runs on to access the VM? Yes, then you can set up routes to access the docker VM. That allows you to have one ZT client on the base host and in the future add more docker images and the routing will be in place for the entire network used by the docker containers or you can add static routes for each docker container.

Initially I wanted it to be in the same docker container as prebuilt image, but yeah documentation and what you and others have said would make it so much easier.

More replies

oblique rant:

Capt Stux on YT - a TrueNAS forums dude - has a guide demonstrating how to set up docker containers on TrueNAS using Jailmaker, with Jellyfin as a worked example. ❤️

It is zero fluff.

Even so, it takes him 20 minutes of non-stop configuring including manually editing config files, downloading setup scripts “somebody” has put together (trust me bro) and if you don’t already understand why he is doing all the things he does, you won’t know at the end, as it is a how-to not a here’s-why lesson.

Then not long after he’d published it, Jailmaker devs decided to remove one of the steps, the ‘install’ action (why? to make their docker container manager harder to set up?) and so even if you follow Capt Stux’s instructions to the letter now it won’t work… there is a note in a comment pointing you to a page with some stuff to do to replace the ‘install’ command instruction, but…

my point is that I understand OPs pain, the flip ‘just use a docker container’ trope is a bit trite, and it needs to be (a) a lot easier to get a system ready for docker containers and (b) a lot easier to get stuff running as docker containers (c) it should be a lot more obvious what you need to do to get tools cooperating [now we’re in a world of ‘oh no, you mustn’t actually install apps directly on OSes that is far too risky, you need isolated buckets within virtualised environments that may or may not talk to one another coz it’s better for security sorry nothing talks to anything else now]

Zerotier support for docker is a mess. That is what drove me away from it to tailscale. Tailscale has much better documentation and works quite well with docker. As the other commenter pointed out, it would just be better to run zerotier in the VM.