mirror of
https://github.com/jbowdre/tailscale-docker.git
synced 2024-11-25 19:22:18 +00:00
environment variable auth key
This commit is contained in:
parent
1009329b49
commit
beb2ad6bb6
5 changed files with 15 additions and 8 deletions
|
@ -15,5 +15,4 @@ A nginx layer is added. It manages two services in independent containers at loc
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
- auth key as a secret
|
- force reuse hostname in tailscale instead of adding suffix. Example: first container is assigned `hostname`. Then, if container is recreated, Tailscale assigns `hostname-1`. Possibly helpful [info](https://tailscale.com/kb/1111/ephemeral-nodes/#can-i-create-an-ephemeral-node-without-an-auth-key).
|
||||||
- force reuse hostname in tailscale instead of adding suffix. Example: first start is assigned `hostname`. Then, if container is recreated, Tailscale assigns `hostname-1`
|
|
|
@ -3,6 +3,8 @@ services:
|
||||||
tailscale:
|
tailscale:
|
||||||
build:
|
build:
|
||||||
context: ./tailscale
|
context: ./tailscale
|
||||||
|
environment:
|
||||||
|
- TAILSCALE_AUTH_KEY
|
||||||
nginx:
|
nginx:
|
||||||
build:
|
build:
|
||||||
context: ./nginx
|
context: ./nginx
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
#!/bin/ash
|
#!/bin/ash
|
||||||
echo "Starting TS daemon"
|
echo "Starting TS daemon"
|
||||||
tailscaled --tun=userspace-networking &
|
tailscaled --tun=userspace-networking &
|
||||||
sleep 5
|
PID=$!
|
||||||
tailscale up --authkey=TAILSCALE_AUTH_KEY --hostname=complex-example
|
until tailscale up --authkey=${TAILSCALE_AUTH_KEY} --hostname=complex-example; do
|
||||||
|
sleep 0.1
|
||||||
|
done
|
||||||
tailscale status
|
tailscale status
|
||||||
sleep infinity
|
wait ${PID}
|
|
@ -3,6 +3,8 @@ services:
|
||||||
tailscale:
|
tailscale:
|
||||||
build:
|
build:
|
||||||
context: ./tailscale
|
context: ./tailscale
|
||||||
|
environment:
|
||||||
|
- TAILSCALE_AUTH_KEY
|
||||||
some-service-1:
|
some-service-1:
|
||||||
image: nginxdemos/hello
|
image: nginxdemos/hello
|
||||||
network_mode: "service:tailscale"
|
network_mode: "service:tailscale"
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
#!/bin/ash
|
#!/bin/ash
|
||||||
echo "Starting TS daemon"
|
echo "Starting TS daemon"
|
||||||
tailscaled --tun=userspace-networking &
|
tailscaled --tun=userspace-networking &
|
||||||
sleep 5
|
PID=$!
|
||||||
tailscale up --authkey=TAILSCALE_AUTH_KEY --hostname=simple-docker-compose
|
until tailscale up --authkey=${TAILSCALE_AUTH_KEY} --hostname=complex-example; do
|
||||||
|
sleep 0.1
|
||||||
|
done
|
||||||
tailscale status
|
tailscale status
|
||||||
sleep infinity
|
wait ${PID}
|
Loading…
Reference in a new issue