mirror of
https://github.com/jbowdre/tailscale-docker.git
synced 2024-11-22 01:52: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
|
||||
|
||||
- auth key as a secret
|
||||
- force reuse hostname in tailscale instead of adding suffix. Example: first start is assigned `hostname`. Then, if container is recreated, Tailscale assigns `hostname-1`
|
||||
- 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).
|
|
@ -3,6 +3,8 @@ services:
|
|||
tailscale:
|
||||
build:
|
||||
context: ./tailscale
|
||||
environment:
|
||||
- TAILSCALE_AUTH_KEY
|
||||
nginx:
|
||||
build:
|
||||
context: ./nginx
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
#!/bin/ash
|
||||
echo "Starting TS daemon"
|
||||
tailscaled --tun=userspace-networking &
|
||||
sleep 5
|
||||
tailscale up --authkey=TAILSCALE_AUTH_KEY --hostname=complex-example
|
||||
PID=$!
|
||||
until tailscale up --authkey=${TAILSCALE_AUTH_KEY} --hostname=complex-example; do
|
||||
sleep 0.1
|
||||
done
|
||||
tailscale status
|
||||
sleep infinity
|
||||
wait ${PID}
|
|
@ -3,6 +3,8 @@ services:
|
|||
tailscale:
|
||||
build:
|
||||
context: ./tailscale
|
||||
environment:
|
||||
- TAILSCALE_AUTH_KEY
|
||||
some-service-1:
|
||||
image: nginxdemos/hello
|
||||
network_mode: "service:tailscale"
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
#!/bin/ash
|
||||
echo "Starting TS daemon"
|
||||
tailscaled --tun=userspace-networking &
|
||||
sleep 5
|
||||
tailscale up --authkey=TAILSCALE_AUTH_KEY --hostname=simple-docker-compose
|
||||
PID=$!
|
||||
until tailscale up --authkey=${TAILSCALE_AUTH_KEY} --hostname=complex-example; do
|
||||
sleep 0.1
|
||||
done
|
||||
tailscale status
|
||||
sleep infinity
|
||||
wait ${PID}
|
Loading…
Reference in a new issue