github.com/authzed/spicedb@v1.32.1-0.20240520085336-ebda56537386/Dockerfile (about)

     1  FROM golang:1.22.3-alpine3.18 AS spicedb-builder
     2  WORKDIR /go/src/app
     3  RUN apk update && apk add --no-cache git
     4  COPY . .
     5  RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg/mod CGO_ENABLED=0 go build -v ./cmd/...
     6  
     7  FROM golang:1.22.2-alpine3.18 AS health-probe-builder
     8  WORKDIR /go/src/app
     9  RUN apk update && apk add --no-cache git
    10  RUN git clone https://github.com/grpc-ecosystem/grpc-health-probe.git
    11  WORKDIR /go/src/app/grpc-health-probe
    12  RUN git checkout bea3bb2419f2d0f0cd4a97b8190e8fafb3e48dda
    13  RUN CGO_ENABLED=0 go install -a -tags netgo -ldflags=-w
    14  
    15  FROM cgr.dev/chainguard/static:latest
    16  #COPY --from=ghcr.io/grpc-ecosystem/grpc-health-probe:v0.4.20 /ko-app/grpc-health-probe /usr/local/bin/grpc_health_probe
    17  COPY --from=health-probe-builder /go/bin/grpc-health-probe /bin/grpc_health_probe
    18  COPY --from=spicedb-builder /go/src/app/spicedb /usr/local/bin/spicedb
    19  ENV PATH="$PATH:/usr/local/bin"
    20  EXPOSE 50051
    21  ENTRYPOINT ["spicedb"]