diff --git a/Dockerfile b/Dockerfile index d0e0130f..b2b2d0f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,3 @@ -FROM golang:1.22-alpine3.20 AS builder - -RUN go install -v -ldflags "-s -w" google.golang.org/protobuf/cmd/protoc-gen-go@latest &&\ - go install -v -ldflags "-s -w" google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest - -COPY . /src - -WORKDIR /src/protoc-gen-gripmock - -RUN go install -v -ldflags "-s -w" - FROM golang:1.22-alpine3.20 as protoc-builder ENV PROTOC_VERSION=27.2 @@ -31,6 +20,17 @@ RUN apk --no-cache add git curl unzip \ && find /usr/include/protobuf -not -name "*.proto" -type f -delete \ && find /usr/include/googleapis -not -name "*.proto" -type f -delete +FROM golang:1.22-alpine3.20 AS builder + +RUN go install -v -ldflags "-s -w" google.golang.org/protobuf/cmd/protoc-gen-go@latest &&\ + go install -v -ldflags "-s -w" google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest + +COPY . /src + +WORKDIR /src/protoc-gen-gripmock + +RUN go install -v -ldflags "-s -w" + FROM golang:1.22-alpine3.20 LABEL org.opencontainers.image.source=https://github.com/bavix/gripmock