-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
32 lines (25 loc) · 914 Bytes
/
Containerfile
File metadata and controls
32 lines (25 loc) · 914 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
27
28
29
30
31
FROM golang:1.24 AS build
ENV DEBIAN_FRONTEND=noninteractive
ENV GOPATH=/go
RUN apt-get update && apt-get install -y --no-install-recommends \
unzip \
&& rm -rf /var/lib/apt/lists/*
ENV PB_REL="https://github.com/protocolbuffers/protobuf/releases"
RUN curl -LO $PB_REL/download/v30.2/protoc-30.2-linux-x86_64.zip \
&& unzip protoc-30.2-linux-x86_64.zip -d /go \
&& rm protoc-30.2-linux-x86_64.zip
WORKDIR /go/src/app
COPY .git .git
COPY go.mod go.sum Makefile ./
COPY cmd/ cmd/
COPY internal/ internal/
COPY proto/ proto/
RUN \
--mount=type=cache,target=/go/pkg/mod,sharing=locked \
--mount=type=cache,target=/go/bin,sharing=locked \
--mount=type=cache,target=/go/include,sharing=locked \
make gen \
&& make CGO_ENABLED=0 GOOS=linux GOOARCH=amd64 build
FROM gcr.io/distroless/static-debian11 AS app
COPY --from=build /go/src/app/bin/dp-server /
ENTRYPOINT ["/dp-server"]