Skip to content

Commit

Permalink
tbw: add go-cacher
Browse files Browse the repository at this point in the history
Updates tailscale/go#77
Updates tailscale/tailcsale#9841

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
  • Loading branch information
bradfitz committed Oct 23, 2023
1 parent 8b012cb commit 42eb69d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Dockerfile.tbw
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
FROM golang:1.21 AS build

WORKDIR /go/src/tbw
RUN mkdir -p /out

COPY go.mod go.sum .
RUN go mod download
ENV CGO_ENABLED=0
ENV GOBIN=/out
RUN go install github.com/bradfitz/go-tool-cache/cmd/go-cacher

COPY . .
RUN mkdir -p /out
RUN go build -o /out/tbw ./tbw
RUN go install ./tbw

# Deploy
FROM debian:bookworm
Expand All @@ -18,4 +20,6 @@ RUN apt-get update && apt-get install -y \
ca-certificates git curl jq strace

COPY --from=build /out/tbw /tbw
COPY --from=build /out/go-cacher /usr/local/bin/go-cacher

CMD ["/tbw"]
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ go 1.21

toolchain go1.21.3

require tailscale.com v1.50.1
require (
github.com/bradfitz/go-tool-cache v0.0.0-20230425225207-ef6c7b1b26e9
tailscale.com v1.50.1
)

require (
filippo.io/edwards25519 v1.0.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8=
github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bradfitz/go-tool-cache v0.0.0-20230425225207-ef6c7b1b26e9 h1:A7mRm2K7DIAaL6pC8xk3vziokHYWCgLxkIq5+hxvxb0=
github.com/bradfitz/go-tool-cache v0.0.0-20230425225207-ef6c7b1b26e9/go.mod h1:tjGzW4FGE+ljtBMRJvTjP+4hTHVpY2MRC/+bTjGLMBs=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cilium/ebpf v0.10.0 h1:nk5HPMeoBXtOzbkZBWym+ZWq1GIiHUsBFXxwewXAHLQ=
Expand Down
7 changes: 7 additions & 0 deletions tbw/cmd_deps.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//go:build deps_just_for_go_mod_tidy

package main

import (
_ "github.com/bradfitz/go-tool-cache/cmd/go-cacher"
)

0 comments on commit 42eb69d

Please sign in to comment.