-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (25 loc) · 884 Bytes
/
Dockerfile
File metadata and controls
36 lines (25 loc) · 884 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
32
33
34
35
36
ARG GO_VERSION=1.25
FROM golang:${GO_VERSION}-bookworm AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG TARGETOS=linux
ARG TARGETARCH=amd64
ARG VERSION=dev
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \
go build \
-trimpath \
-buildvcs=false \
-ldflags="-s -w -X github.com/graphprotocol/substreams-data-service.Version=${VERSION}" \
-o /out/sds \
./cmd/sds
FROM gcr.io/distroless/static-debian12:nonroot
LABEL org.opencontainers.image.title="Substreams Data Service"
LABEL org.opencontainers.image.description="Provider gateway for Substreams Data Service"
LABEL org.opencontainers.image.source="https://github.com/graphprotocol/substreams-data-service"
COPY --from=build /out/sds /usr/local/bin/sds
USER nonroot:nonroot
WORKDIR /
ENTRYPOINT ["/usr/local/bin/sds"]
CMD ["provider", "gateway", "--help"]