-
Notifications
You must be signed in to change notification settings - Fork 436
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (18 loc) · 862 Bytes
/
Dockerfile
File metadata and controls
26 lines (18 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
FROM golang:1.25.1-bookworm@sha256:c423747fbd96fd8f0b1102d947f51f9b266060217478e5f9bf86f145969562ee as build
WORKDIR /trillian
ARG GOFLAGS=""
ENV GOFLAGS=$GOFLAGS
# Download dependencies first - this should be cacheable.
COPY go.mod go.sum ./
RUN go mod download
# Now add the local Trillian repo, which typically isn't cacheable.
COPY . .
# Build the server.
RUN go install ./cmd/trillian_log_server
# Run the licensing tool and save licenses, copyright notices, etc.
RUN go run github.com/google/go-licenses/v2 save ./cmd/trillian_log_server --save_path /THIRD_PARTY_NOTICES
# Make a minimal image.
FROM gcr.io/distroless/base-debian12@sha256:fa15492938650e1a5b87e34d47dc7d99a2b4e8aefd81b931b3f3eb6bb4c1d2f6
COPY --from=build /go/bin/trillian_log_server /
COPY --from=build /THIRD_PARTY_NOTICES /THIRD_PARTY_NOTICES
ENTRYPOINT ["/trillian_log_server"]