stagex/packages/protoc-gen-go-grpc/Containerfile

37 lines
961 B
Text
Raw Permalink Normal View History

2024-08-08 07:47:42 +00:00
FROM scratch AS base
ENV VERSION=1.67.0
ENV SRC_HASH=1d50c8df1935aae7d2c734a0ec1e9cead7552443af8a03852abd2244e0a7fb55
ENV SRC_FILE=v${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/grpc/grpc-go/archive/refs/tags/${SRC_FILE}
2024-08-08 07:47:42 +00:00
FROM base AS fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
2024-08-08 07:47:42 +00:00
FROM fetch AS build
COPY --from=stagex/busybox . /
COPY --from=stagex/go . /
COPY --from=stagex/ca-certificates . /
RUN tar -xvf v${VERSION}.tar.gz
2024-08-26 01:18:52 +00:00
WORKDIR /grpc-go-${VERSION}/cmd/protoc-gen-go-grpc
2024-08-27 06:51:27 +00:00
ENV GOPATH=/cache/go
ENV GOCACHE=/cache/
ENV GOWORK=off
ENV GOPROXY=https://proxy.golang.org,direct
ENV GOSUMDB=sum.golang.org
ENV CGO_ENABLED=0
ENV GOHOSTOS=linux
ENV GOHOSTARCH=amd64
ENV GOFLAGS=-trimpath
RUN mkdir -p ${GOPATH}
RUN go build -o bin/protoc-gen-go-grpc ./
2024-08-08 07:50:50 +00:00
FROM build AS install
RUN <<-EOF
set -eux
mkdir -p /rootfs/usr/bin/
cp bin/protoc-gen-go-grpc /rootfs/usr/bin/
EOF
2024-08-08 07:47:42 +00:00
FROM stagex/filesystem AS package
COPY --from=install /rootfs/./ /