From 864627c3c90f85725ec875ed6c7159d0da8aea64 Mon Sep 17 00:00:00 2001 From: "Marlon (esolitos) Saglia" Date: Tue, 19 Sep 2023 14:24:25 +0200 Subject: [PATCH] fix: update php-tailscale container --- templates/drupal-sshd/default.Dockerfile | 12 +++++------- templates/drupal-sshd/init-tailscale.sh | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/templates/drupal-sshd/default.Dockerfile b/templates/drupal-sshd/default.Dockerfile index 1ec8deb..9c1520c 100644 --- a/templates/drupal-sshd/default.Dockerfile +++ b/templates/drupal-sshd/default.Dockerfile @@ -8,14 +8,12 @@ COPY --chown=1000:1000 ${COPY_FROM} ${COPY_TO} USER root # Copy Tailscale binaries from the tailscale image on Docker Hub. -COPY --from=docker.io/tailscale/tailscale:stable /usr/local/bin/tailscaled /var/runtime/tailscaled -COPY --from=docker.io/tailscale/tailscale:stable /usr/local/bin/tailscale /var/runtime/tailscale -RUN mkdir -p /var/run && ln -s /tmp/tailscale /var/run/tailscale && \ - mkdir -p /var/cache && ln -s /tmp/tailscale /var/cache/tailscale && \ - mkdir -p /var/lib && ln -s /tmp/tailscale /var/lib/tailscale && \ - mkdir -p /var/task && ln -s /tmp/tailscale /var/task/tailscale - +COPY --from=docker.io/tailscale/tailscale:stable /usr/local/bin/tailscaled /usr/local/bin/tailscaled +COPY --from=docker.io/tailscale/tailscale:stable /usr/local/bin/tailscale /usr/local/bin/tailscale +COPY --from=docker.io/tailscale/tailscale:stable /usr/local/bin/containerboot /usr/local/bin/ts-containerboot COPY ${COPY_FROM}/infrastructure/docker/drupal-sshd/init-tailscale.sh /docker-entrypoint-init.d/ USER wodby + +CMD [ "sleep", "infinity" ] diff --git a/templates/drupal-sshd/init-tailscale.sh b/templates/drupal-sshd/init-tailscale.sh index a67f105..c860660 100644 --- a/templates/drupal-sshd/init-tailscale.sh +++ b/templates/drupal-sshd/init-tailscale.sh @@ -1,6 +1,14 @@ #!/usr/bin/env bash -mkdir -p /tmp/tailscale -/var/runtime/tailscaled --tun=userspace-networking --socks5-server=localhost:1055 & -/var/runtime/tailscale up --ssh --authkey=${TAILSCALE_AUTHKEY} --hostname=${TAILSCALE_NAME} -echo "Tailscale started!" +# Start and configure tailscale(d) using the same setup as the official tailscale container: +# @see https://hub.docker.com/r/tailscale/tailscale +# @see https://github.com/tailscale/tailscale/blob/main/cmd/containerboot/main.go + +/usr/local/bin/ts-containerboot & + +# Leave some time for tailscaled to start and connect to the Tailscale network. +sleep 5 + +# Start the tailscale-powered sshd server. +tailscale set --ssh +echo "Tailscale SSH server enabled."