forked from tijjjy/Tailscale-DERP-Docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (34 loc) · 1.24 KB
/
Dockerfile
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM golang:latest AS builder
WORKDIR /app
# https://tailscale.com/kb/1118/custom-derp-servers/
RUN go install tailscale.com/cmd/derper@main
# use for healthcheck
RUN go install tailscale.com/cmd/derpprobe@latest
FROM ubuntu:jammy
WORKDIR /app
LABEL org.opencontainers.image.source https://github.com/cmj2002/Tailscale-DERP-Docker
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends apt-utils && \
apt-get install -y ca-certificates curl && \
apt-get clean
RUN curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.noarmor.gpg | tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
RUN curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.tailscale-keyring.list | tee /etc/apt/sources.list.d/tailscale.list
RUN apt-get update && \
apt-get install -y tailscale && \
apt-get clean
RUN mkdir /app/certs
ENV DERP_DOMAIN your-hostname.com
ENV DERP_CERT_MODE letsencrypt
ENV DERP_CERT_DIR /app/certs
ENV DERP_ADDR :443
ENV DERP_STUN true
ENV DERP_HTTP_PORT 80
ENV TAILSCALE_SLEEP 2
COPY --from=builder /go/bin/derper .
COPY --from=builder /go/bin/derpprobe .
COPY init.sh /init.sh
COPY health.sh /health.sh
RUN chmod +x /init.sh
RUN chmod +x /health.sh
ENTRYPOINT /init.sh