mirror of
https://github.com/juanfont/headscale.git
synced 2026-07-21 10:28:56 +00:00
Some checks are pending
Build / build-nix (push) Waiting to run
Build / build-cross (GOARCH=amd64 GOOS=darwin) (push) Waiting to run
Build / build-cross (GOARCH=amd64 GOOS=linux) (push) Waiting to run
Build / build-cross (GOARCH=arm64 GOOS=darwin) (push) Waiting to run
Build / build-cross (GOARCH=arm64 GOOS=linux) (push) Waiting to run
Check Generated Files / check-generated (push) Waiting to run
Build (main) / container (push) Waiting to run
Build (main) / binaries (amd64, darwin) (push) Waiting to run
Build (main) / binaries (amd64, linux) (push) Waiting to run
Build (main) / binaries (arm64, darwin) (push) Waiting to run
Build (main) / binaries (arm64, linux) (push) Waiting to run
Nix Flake Checks / build (push) Waiting to run
Nix Flake Checks / gotest (push) Waiting to run
Nix Flake Checks / golangci-lint (push) Waiting to run
Nix Flake Checks / formatting (push) Waiting to run
NixOS Module Tests / nix-module-check (push) Waiting to run
Server Tests / servertest (push) Waiting to run
Tailscale HEAD go.mod now requires go >= 1.26.5; build images pinned 1.26.4. Bump go.mod, the four Go Dockerfiles, and the nixpkgs pin (staging-next-26.05 ships go_1_26 1.26.5; unstable still lags).
44 lines
1.5 KiB
Text
44 lines
1.5 KiB
Text
# This Dockerfile and the images produced are for testing headscale,
|
|
# and are in no way endorsed by Headscale's maintainers as an
|
|
# official nor supported release or distribution.
|
|
|
|
FROM docker.io/golang:1.26.5-trixie AS builder
|
|
ARG VERSION=dev
|
|
ENV GOPATH /go
|
|
WORKDIR /go/src/headscale
|
|
|
|
# Install delve debugger first - rarely changes, good cache candidate
|
|
RUN go install github.com/go-delve/delve/cmd/dlv@latest
|
|
|
|
# Download dependencies - only invalidated when go.mod/go.sum change
|
|
COPY go.mod go.sum /go/src/headscale/
|
|
RUN go mod download
|
|
|
|
# Copy source and build - invalidated on any source change
|
|
COPY . .
|
|
|
|
# Build debug binary with debug symbols for delve
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -gcflags="all=-N -l" -o /go/bin/headscale ./cmd/headscale
|
|
|
|
# Runtime stage
|
|
FROM debian:trixie-slim
|
|
|
|
RUN apt-get --update install --no-install-recommends --yes \
|
|
bash ca-certificates curl dnsutils findutils iproute2 jq less procps python3 sqlite3 \
|
|
&& apt-get dist-clean
|
|
|
|
RUN mkdir -p /var/run/headscale
|
|
|
|
# Copy binaries from builder
|
|
COPY --from=builder /go/bin/headscale /usr/local/bin/headscale
|
|
COPY --from=builder /go/bin/dlv /usr/local/bin/dlv
|
|
|
|
# Copy source code for delve source-level debugging
|
|
COPY --from=builder /go/src/headscale /go/src/headscale
|
|
|
|
WORKDIR /go/src/headscale
|
|
|
|
# Need to reset the entrypoint or everything will run as a busybox script
|
|
ENTRYPOINT []
|
|
EXPOSE 8080/tcp 40000/tcp
|
|
CMD ["dlv", "--listen=0.0.0.0:40000", "--headless=true", "--api-version=2", "--accept-multiclient", "exec", "/usr/local/bin/headscale", "--"]
|