initial commit

This commit is contained in:
Seán C McCord 2020-08-06 12:43:51 -04:00
commit 58bb6a4a95
3 changed files with 37 additions and 0 deletions

26
Dockerfile Normal file
View file

@ -0,0 +1,26 @@
FROM alpine:3.11 AS build
ARG CHANNEL=unstable
ARG VERSION=0.99.1-127
ARG ARCH=amd64
RUN mkdir /build
WORKDIR /build
RUN apk add --no-cache curl tar
RUN curl -vsLo tailscale.tar.gz "https://pkgs.tailscale.com/${CHANNEL}/tailscale_${VERSION}_${ARCH}.tgz" && \
tar xvf tailscale.tar.gz && \
mv "tailscale_${VERSION}_${ARCH}/tailscaled" . && \
mv "tailscale_${VERSION}_${ARCH}/tailscale" .
FROM alpine:3.11
# Tailscaled depends on iptables (for now)
RUN apk add --no-cache iptables
COPY --from=build /build/tailscale /usr/bin/
COPY --from=build /build/tailscaled /usr/bin/
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]

4
README.md Normal file
View file

@ -0,0 +1,4 @@
# SCM tailscaled for kubernetes
Taken from gist: https://gist.github.com/hamishforbes/2ac7ae9d7ea47cad4e3a813c9b45c10f

7
entrypoint.sh Normal file
View file

@ -0,0 +1,7 @@
# Create the tun device path if required
if [ ! -d /dev/net ]; then mkdir /dev/net; fi
if [ ! -e /dev/net/tun ]; then mknod /dev/net/tun c 10 200; fi
# Wait 5s for the daemon to start and then run tailscale up to configure
/bin/sh -c "sleep 5; tailscale up --authkey=${TAILSCALE_AUTH} -advertise-tags=${TAILSCALE_TAGS}" &
exec /usr/bin/tailscaled --state=/tailscale/tailscaled.state