Sign inSign up

cookding/tailscale-derper

By cookding

Updated 19 days ago

Dockerize tailscale.com/cmd/derper released versions

Image
Networking
0

1.6K

cookding/tailscale-derper repository overview

tailscale-derper

Dockerize tailscale.com/cmd/derper released versions.

Environment Variables

NameDescriptionDefault Value
DERP_DOMAINDerper server hostnameyour-hostname.com
DERP_CERTPath to the SSL certificate/app/certs/your-hostname.com.cer
DERP_CERT_KEYPath to the SSL certificate key/app/certs/your-hostname.com.key
DERP_ADDRListening server address:443
DERP_STUNWhether also run a STUN servertrue
DERP_STUN_PORTThe UDP port on which to serve STUN.3478
DERP_HTTP_PORTThe port on which to serve HTTP. Set to -1 to disable80
DERP_VERIFY_CLIENTSWhether verify clients to this DERP server through a local tailscaled instancefalse

Files

Dockerfile

ARG DOCKERHUB_REGISTRY=docker.io
ARG VERSION=1.66.4
ARG GOLANG_VERSION=1.22.4

FROM ${DOCKERHUB_REGISTRY}/library/golang:${GOLANG_VERSION} AS builder
ARG VERSION
WORKDIR /app

RUN go install tailscale.com/cmd/derper@v${VERSION}

FROM ${DOCKERHUB_REGISTRY}/library/ubuntu:22.04
ARG DOCKERHUB_REGISTRY
WORKDIR /app

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
    apt-get install -y --no-install-recommends apt-utils && \
    apt-get install -y ca-certificates && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ENV DERP_DOMAIN your-hostname.com
ENV DERP_CERT /app/certs/your-hostname.com.cer
ENV DERP_CERT_KEY /app/certs/your-hostname.com.key
ENV DERP_ADDR :443
ENV DERP_STUN true
ENV DERP_STUN_PORT 3478
ENV DERP_HTTP_PORT 80
ENV DERP_VERIFY_CLIENTS false

COPY --from=builder /go/bin/derper .

ADD ./docker_entrypoint.sh /usr/local/bin/docker_entrypoint.sh
RUN chmod a+x /usr/local/bin/docker_entrypoint.sh

ENTRYPOINT ["/usr/local/bin/docker_entrypoint.sh"]

docker_entrypoint.sh

#!/bin/bash

set -ou pipefail

if [ $# -eq 0 ]; then
  mkdir -p /app/certs
  cp ${DERP_CERT} /app/certs/${DERP_DOMAIN}.crt
  cp ${DERP_CERT_KEY} /app/certs/${DERP_DOMAIN}.key
  /app/derper --hostname=${DERP_DOMAIN} \
    --certmode=manual \
    --certdir=/app/certs \
    --a=${DERP_ADDR} \
    --stun=${DERP_STUN}  \
    --stun-port=${DERP_STUN_PORT} \
    --http-port=${DERP_HTTP_PORT} \
    --verify-clients=${DERP_VERIFY_CLIENTS}
else
  exec "$@"
fi

Tag summary

Content type

Image

Digest

sha256:c3dee78c4

Size

42.6 MB

Last updated

19 days ago

docker pull cookding/tailscale-derper:1.102.3