mirror of
https://github.com/juanfont/headscale.git
synced 2026-02-16 12:47:44 +01:00
This commit upgrades the codebase from Go 1.25.5 to Go 1.26rc2 and adopts new language features. Toolchain updates: - go.mod: go 1.25.5 → go 1.26rc2 - flake.nix: buildGo125Module → buildGo126Module, go_1_25 → go_1_26 - flake.nix: build golangci-lint from source with Go 1.26 - Dockerfile.integration: golang:1.25-trixie → golang:1.26rc2-trixie - Dockerfile.tailscale-HEAD: golang:1.25-alpine → golang:1.26rc2-alpine - Dockerfile.derper: golang:alpine → golang:1.26rc2-alpine - .goreleaser.yml: go mod tidy -compat=1.25 → -compat=1.26 - cmd/hi/run.go: fallback Go version 1.25 → 1.26rc2 - .pre-commit-config.yaml: simplify golangci-lint hook entry Code modernization using Go 1.26 features: - Replace tsaddr.SortPrefixes with slices.SortFunc + netip.Prefix.Compare - Replace ptr.To(x) with new(x) syntax - Replace errors.As with errors.AsType[T] Lint rule updates: - Add forbidigo rules to prevent regression to old patterns
48 lines
1.7 KiB
Docker
48 lines
1.7 KiB
Docker
# Copyright (c) Tailscale Inc & AUTHORS
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# This Dockerfile is more or less lifted from tailscale/tailscale
|
|
# to ensure a similar build process when testing the HEAD of tailscale.
|
|
|
|
FROM golang:1.26rc2-alpine AS build-env
|
|
|
|
WORKDIR /go/src
|
|
|
|
RUN apk add --no-cache git
|
|
|
|
# Replace `RUN git...` with `COPY` and a local checked out version of Tailscale in `./tailscale`
|
|
# to test specific commits of the Tailscale client. This is useful when trying to find out why
|
|
# something specific broke between two versions of Tailscale with for example `git bisect`.
|
|
# COPY ./tailscale .
|
|
RUN git clone https://github.com/tailscale/tailscale.git
|
|
|
|
WORKDIR /go/src/tailscale
|
|
|
|
|
|
# see build_docker.sh
|
|
ARG VERSION_LONG=""
|
|
ENV VERSION_LONG=$VERSION_LONG
|
|
ARG VERSION_SHORT=""
|
|
ENV VERSION_SHORT=$VERSION_SHORT
|
|
ARG VERSION_GIT_HASH=""
|
|
ENV VERSION_GIT_HASH=$VERSION_GIT_HASH
|
|
ARG TARGETARCH
|
|
|
|
ARG BUILD_TAGS=""
|
|
|
|
RUN GOARCH=$TARGETARCH go install -tags="${BUILD_TAGS}" -ldflags="\
|
|
-X tailscale.com/version.longStamp=$VERSION_LONG \
|
|
-X tailscale.com/version.shortStamp=$VERSION_SHORT \
|
|
-X tailscale.com/version.gitCommitStamp=$VERSION_GIT_HASH" \
|
|
-v ./cmd/tailscale ./cmd/tailscaled ./cmd/containerboot
|
|
|
|
FROM alpine:3.22
|
|
# Upstream: ca-certificates ip6tables iptables iproute2
|
|
# Tests: curl python3 (traceroute via BusyBox)
|
|
RUN apk add --no-cache ca-certificates curl ip6tables iptables iproute2 python3
|
|
|
|
COPY --from=build-env /go/bin/* /usr/local/bin/
|
|
# For compat with the previous run.sh, although ideally you should be
|
|
# using build_docker.sh which sets an entrypoint for the image.
|
|
RUN mkdir /tailscale && ln -s /usr/local/bin/containerboot /tailscale/run.sh
|