

The official Tailscale subreddit. Not routinely monitored by Tailscale employees. Please contact support via https://tailscale.com/contact/support if you need further help.
How to connect docker containers to tailscale?
Help Needed
I've read through several posts here but haven't found (or rather understood) a straightforward method to connect a docker container to my tailscale network. I am running tailscale on the host machine (not in a docker container) and I would like to connect my delugevpn docker container to this network. I've tried to set up exit nodes and port-forwarding but I'm having a difficult time understanding the process for this. Does anyone have any guidance for this process? Thanks!
Sort by:
Best
Open comment sort options
Best
Top
New
Controversial
Old
Q&A
https://tailscale.dev/blog/docker-mod-tailscale
This looks like a convenient solution! However, when trying to run compose it gives me the error:
yaml: line 8: did not find expected key
. Line 8 in my compose file is where the environment variables start. I added a newly generated auth key toTAILSCALE_AUTHKEY
so I'm not sure why I'm getting this error. Any suggestions?Edit: I moved the mod snippet to the top of the environment variables section and now I get the error
yaml: line 8: did not find expected '-' indicator
. I do have the '' - ' in place though. I am supposed to add the mod snippet to the environment variables of the delugevpn container, correct?You can just specify that the docker's ports attach to the Tailscale IP address like this:
<tailscale-ip>:port:port for e.g. 100.34.89.23:80:80
The networking should be in the host mode, right?
What if it’s bridged, like connected to the network of a reverse proxy container?
Can you have one Tailscale instance on the host, accessing all containers instead of one side car container for each application container, like suggested here
https://tailscale.com/blog/docker-tailscale-guide
So under the ports section of the container (in the compose file) just add
- <tailscale-ip>:port:port
? With the correct IP and port numbers ofc.I know I'm late to the party, but this might be the solution I'm looking for. In theory you would:
Install Tailscale on the machine running docker.
List "<tailscale-ip>:port:port" for the ports in the config file of each docker container.
Now you should be able to access the all the docker containers from a machine inside your tailnet without exposing any ports on the host machine? Also, you wouldn't have to do the service linking, correct?