From 1964b8351f98f0d673e1c5afa740cdade2172744 Mon Sep 17 00:00:00 2001 From: gibbyDev Date: Sat, 20 Jun 2026 13:18:57 -0400 Subject: [PATCH] changed dockerfiles to be compatible with new protoc --- api-gateway/Dockerfile | 11 +++++++---- services/auth-service/Dockerfile | 9 ++++++--- services/post-service/Dockerfile | 11 +++++++---- services/user-service/Dockerfile | 11 +++++++---- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/api-gateway/Dockerfile b/api-gateway/Dockerfile index 7bf9308..a440ab1 100644 --- a/api-gateway/Dockerfile +++ b/api-gateway/Dockerfile @@ -2,12 +2,15 @@ FROM golang:1.24-alpine AS build RUN apk add --no-cache git ca-certificates protobuf-dev WORKDIR /app +ARG PROTOC_GEN_GO_VERSION=v1.36.10 +ARG PROTOC_GEN_GO_GRPC_VERSION=v1.5.1 + COPY go.mod go.sum ./ RUN go mod download -# install Go protoc plugins -RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest && \ - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest +# install Go protoc plugins (pinned for Go 1.24 compatibility) +RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOC_GEN_GO_VERSION} && \ + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION} COPY api-gateway ./api-gateway COPY services/auth-service ./services/auth-service @@ -29,4 +32,4 @@ RUN apk add --no-cache ca-certificates WORKDIR /app COPY --from=build /app/main /app/main EXPOSE 8080 -ENTRYPOINT ["/app/main"] \ No newline at end of file +ENTRYPOINT ["/app/main"] diff --git a/services/auth-service/Dockerfile b/services/auth-service/Dockerfile index 176e0aa..529002d 100644 --- a/services/auth-service/Dockerfile +++ b/services/auth-service/Dockerfile @@ -2,13 +2,16 @@ FROM golang:1.24-alpine AS build RUN apk add --no-cache git ca-certificates protobuf-dev WORKDIR /app +ARG PROTOC_GEN_GO_VERSION=v1.36.10 +ARG PROTOC_GEN_GO_GRPC_VERSION=v1.5.1 + # use repo-level go.mod so modules are resolvable (build.context must be repo root) COPY go.mod go.sum ./ RUN go mod download -# install Go protoc plugins -RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest && \ - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest +# install Go protoc plugins (pinned for Go 1.24 compatibility) +RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOC_GEN_GO_VERSION} && \ + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION} # copy service sources and proto files into the image COPY services/auth-service ./services/auth-service diff --git a/services/post-service/Dockerfile b/services/post-service/Dockerfile index 7b99ea0..feceb1a 100644 --- a/services/post-service/Dockerfile +++ b/services/post-service/Dockerfile @@ -2,13 +2,16 @@ FROM golang:1.24-alpine AS build RUN apk add --no-cache git ca-certificates protobuf-dev WORKDIR /app +ARG PROTOC_GEN_GO_VERSION=v1.36.10 +ARG PROTOC_GEN_GO_GRPC_VERSION=v1.5.1 + # use repo-level go.mod so modules are resolvable COPY go.mod go.sum ./ RUN go mod download -# install Go protoc plugins -RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest && \ - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest +# install Go protoc plugins (pinned for Go 1.24 compatibility) +RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOC_GEN_GO_VERSION} && \ + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION} # copy service sources and proto files COPY services/post-service ./services/post-service @@ -30,4 +33,4 @@ FROM alpine:3.20 RUN apk add --no-cache ca-certificates COPY --from=build /usr/local/bin/post-service /usr/local/bin/post-service EXPOSE 50053 -ENTRYPOINT ["/usr/local/bin/post-service"] \ No newline at end of file +ENTRYPOINT ["/usr/local/bin/post-service"] diff --git a/services/user-service/Dockerfile b/services/user-service/Dockerfile index 4e3637e..1355fd7 100644 --- a/services/user-service/Dockerfile +++ b/services/user-service/Dockerfile @@ -2,13 +2,16 @@ FROM golang:1.24-alpine AS build RUN apk add --no-cache git ca-certificates protobuf-dev WORKDIR /app +ARG PROTOC_GEN_GO_VERSION=v1.36.10 +ARG PROTOC_GEN_GO_GRPC_VERSION=v1.5.1 + # use repo-level go.mod so modules are resolvable COPY go.mod go.sum ./ RUN go mod download -# install Go protoc plugins -RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest && \ - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest +# install Go protoc plugins (pinned for Go 1.24 compatibility) +RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOC_GEN_GO_VERSION} && \ + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION} # copy service sources and proto files COPY services/user-service ./services/user-service @@ -30,4 +33,4 @@ FROM alpine:3.20 RUN apk add --no-cache ca-certificates COPY --from=build /usr/local/bin/user-service /usr/local/bin/user-service EXPOSE 50052 -ENTRYPOINT ["/usr/local/bin/user-service"] \ No newline at end of file +ENTRYPOINT ["/usr/local/bin/user-service"]