-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathtailscale.dockerfile
More file actions
executable file
·28 lines (23 loc) · 1011 Bytes
/
Copy pathtailscale.dockerfile
File metadata and controls
executable file
·28 lines (23 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env -S docker build --compress -t pvtmert/tailscale -f
ARG BASE=debian:stable
FROM ${BASE}
RUN apt update
RUN apt install -y curl procps gnupg apt-transport-https
RUN curl -#Lk https://pkgs.tailscale.com/stable/debian/buster.gpg \
| apt-key add -
RUN curl -#Lk https://pkgs.tailscale.com/stable/debian/buster.list \
| tee /etc/apt/sources.list.d/tailscale.list
ENV INTERFACE "tailscale0"
RUN apt update
RUN apt install -y tailscale
RUN echo '#!/usr/bin/env bash\n\
ARGS=( "$@" )\n\
test -n "${AUTHKEY}" && ARGS+=( "--authkey=${AUTHKEY}" ) \n\
trap "tailscaled -cleanup; pkill -eP 1;" RETURN EXIT TERM HUP INT ; \n\
tailscaled --tun="${INTERFACE:-tailscale0}" & \n\
until test -e /var/run/tailscale/tailscaled.sock \n\
do :; done && tailscale up "${ARGS[@]}" || pkill -eP 1 & \n\
wait\n' | tee /docker-entrypoint.sh
VOLUME /var/lib/tailscale
ENTRYPOINT [ "bash", "-exo", "pipefail", "/docker-entrypoint.sh" ]
CMD [ "--accept-dns=true", "--accept-routes=true", "--host-routes=true" ]