Skip to content

Commit

Permalink
Pre-build the tsnet/ts client deps on the go module layer
Browse files Browse the repository at this point in the history
This should concentrate the bulk of the build duration on the
dependency level, since it's tsnet that pulls in all those
libraries (and it changes rarely).
  • Loading branch information
antifuchs committed Aug 16, 2023
1 parent 3e59d40 commit 033ae4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ ENV CGO_ENABLED=0
COPY go.mod go.sum ./
RUN go mod download && \
go mod verify && \
echo 'package main\nimport (_ "tailscale.com/tsnet")\nfunc main(){}' > main.go && \
go build -v ./ && \
echo 'package main\nimport (\n_ "tailscale.com/tsnet"\n_ "tailscale.com/client/tailscale"\n)\nfunc main(){}' > main.go && \
go build -ldflags="-s -w" -v ./ && \
rm main.go

COPY . .
Expand Down

0 comments on commit 033ae4e

Please sign in to comment.