mirror of
https://github.com/jbowdre/tailscale-docker.git
synced 2024-11-22 10:02:18 +00:00
Set optional tailscaled flags with TAILSCALE_OPT (#6)
* Allow user to set additional Tailscaled options * Added example use of TAILSCALE_OPT
This commit is contained in:
parent
45916632fa
commit
9626fd835c
2 changed files with 4 additions and 2 deletions
|
@ -7,6 +7,8 @@ services:
|
||||||
TAILSCALE_AUTH_KEY: ${TAILSCALE_AUTH_KEY:?err}
|
TAILSCALE_AUTH_KEY: ${TAILSCALE_AUTH_KEY:?err}
|
||||||
TAILSCALE_HOSTNAME: ${TAILSCALE_HOSTNAME:-tailscale-docker-simple-example}
|
TAILSCALE_HOSTNAME: ${TAILSCALE_HOSTNAME:-tailscale-docker-simple-example}
|
||||||
TAILSCALE_STATE_ARG: "mem:"
|
TAILSCALE_STATE_ARG: "mem:"
|
||||||
|
# (optional) set additional flags on tailscaled
|
||||||
|
# TAILSCALE_OPT: --outbound-http-proxy-listen=localhost:1055
|
||||||
some-service-1:
|
some-service-1:
|
||||||
image: nginxdemos/hello
|
image: nginxdemos/hello
|
||||||
network_mode: "service:tailscale"
|
network_mode: "service:tailscale"
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
trap 'kill -TERM $PID' TERM INT
|
trap 'kill -TERM $PID' TERM INT
|
||||||
echo "Starting Tailscale daemon"
|
echo "Starting Tailscale daemon"
|
||||||
# -state=mem: will logout and remove ephemeral node from network immediately after ending.
|
# -state=mem: will logout and remove ephemeral node from network immediately after ending.
|
||||||
tailscaled --tun=userspace-networking --state=${TAILSCALE_STATE_ARG} &
|
tailscaled --tun=userspace-networking --state=${TAILSCALE_STATE_ARG} ${TAILSCALE_OPT} &
|
||||||
PID=$!
|
PID=$!
|
||||||
until tailscale up --authkey="${TAILSCALE_AUTH_KEY}" --hostname="${TAILSCALE_HOSTNAME}"; do
|
until tailscale up --authkey="${TAILSCALE_AUTH_KEY}" --hostname="${TAILSCALE_HOSTNAME}"; do
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
done
|
done
|
||||||
tailscale status
|
tailscale status
|
||||||
wait ${PID}
|
wait ${PID}
|
||||||
wait ${PID}
|
wait ${PID}
|
||||||
|
|
Loading…
Reference in a new issue