Docker secrets
If you want to use Docker secrets to store your Tailscale authkey, you can use the following example:
Requirements
Make sure you have Docker Swarm enabled on your server.
https://docs.docker.com/engine/swarm/secrets/
“Docker secrets are only available to swarm services, not to standalone containers. To use this feature, consider adapting your container to run as a service.”
Add a docker secret
We need to create a docker secret, which we can name authkey and store the Tailscale
authkey in it. We can do that using the following command:
printf "Your Tailscale AuthKey" | docker secret create authkey -TSDProxy Docker compose
docker-compose.yml
services:
tsdproxy:
image: almeidapaulopt/tsdproxy:2
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- datadir:/data
- <PATH TO CONFIG>:/config
secrets:
- authkey
volumes:
datadir:
secrets:
authkey:
external: trueTSDProxy configuration
/config/tsdproxy.yaml
tailscale:
providers:
default:
authKeyFile: "/run/secrets/authkey"Caution
Configuration files are case-sensitive. The field is authKeyFile (camelCase), not authkeyfile.
Restart TSDProxy
docker compose restartLast updated on