Skip to content

Commit

Permalink
fix: update php-tailscale container
Browse files Browse the repository at this point in the history
  • Loading branch information
esolitos committed Sep 20, 2023
1 parent 9355547 commit 864627c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
12 changes: 5 additions & 7 deletions templates/drupal-sshd/default.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
16 changes: 12 additions & 4 deletions templates/drupal-sshd/init-tailscale.sh
Original file line number Diff line number Diff line change
@@ -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."

0 comments on commit 864627c

Please sign in to comment.