| 1 | # Builds the official Tailscale v1.102.3 source at its verified commit with the |
| 2 | # narrow PortlistServices eventbus fix. Upstream issue: #18297. |
| 3 | |
| 4 | FROM golang:1.26-alpine AS build |
| 5 | ARG TAILSCALE_COMMIT=53a0d659afa51835dd7a9283873cca44261454f8 |
| 6 | ARG VERSION_LONG=1.102.3 |
| 7 | ARG VERSION_SHORT=1.102.3 |
| 8 | ARG VERSION_GIT_HASH=53a0d659afa51835dd7a9283873cca44261454f8 |
| 9 | WORKDIR /go/src/tailscale |
| 10 | RUN apk add --no-cache git ca-certificates |
| 11 | RUN git init . \ |
| 12 | && git remote add origin https://github.com/tailscale/tailscale.git \ |
| 13 | && git fetch --depth=1 origin ${TAILSCALE_COMMIT} \ |
| 14 | && git checkout --detach ${TAILSCALE_COMMIT} |
| 15 | COPY tailscale-portlist.patch /tmp/tailscale-portlist.patch |
| 16 | RUN git apply /tmp/tailscale-portlist.patch |
| 17 | RUN go mod download |
| 18 | RUN go install \ |
| 19 | github.com/aws/aws-sdk-go-v2/aws \ |
| 20 | github.com/aws/aws-sdk-go-v2/config \ |
| 21 | gvisor.dev/gvisor/pkg/tcpip/adapters/gonet \ |
| 22 | gvisor.dev/gvisor/pkg/tcpip/stack \ |
| 23 | golang.org/x/crypto/ssh \ |
| 24 | golang.org/x/crypto/acme \ |
| 25 | github.com/coder/websocket \ |
| 26 | github.com/mdlayher/netlink |
| 27 | ARG TARGETARCH |
| 28 | RUN GOARCH=${TARGETARCH} go install \ |
| 29 | -tags=ts_kube,ts_package_container \ |
| 30 | -ldflags="-X tailscale.com/version.longStamp=${VERSION_LONG} -X tailscale.com/version.shortStamp=${VERSION_SHORT} -X tailscale.com/version.gitCommitStamp=${VERSION_GIT_HASH}" \ |
| 31 | ./cmd/tailscale ./cmd/tailscaled ./cmd/containerboot |
| 32 | |
| 33 | # Keep the official container filesystem, entry command, and runtime support. |
| 34 | FROM tailscale/tailscale@sha256:8c42c4574ab066384fcb72f69e086a2ff1dd3652eb6f56856cee34bcf0d2f680 |
| 35 | COPY --from=build /go/bin/* /usr/local/bin/ |