Skip to content

Commit 37aa1cd

Browse files
authored
fix: develop container image build (#46)
chore: Fix the following issue while tring to build the develop container, (reproducible locally with: `make build`): ``` go: downloading gopkg.in/yaml.v3 v3.0.1 /root/go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway/[email protected]/protoc-gen-grpc-gateway/main.go:18:2: github.com/golang/[email protected]: missing go.sum entry for go.mod file; to add it: go mod download github.com/golang/glog ``` Signed-off-by: Spolti <[email protected]>
1 parent 32c7c01 commit 37aa1cd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,15 @@ RUN set -eux; \
7777
WORKDIR /opt/app
7878

7979
COPY go.mod go.sum ./
80+
# Download dependencies before copying the source so they will be cached
81+
RUN go mod download
8082

8183
# Install go protoc plugins,
8284
# no required module provides package google.golang.org/grpc/cmd/protoc-gen-go-grpc
8385
# to add it run `go get google.golang.org/grpc/cmd/protoc-gen-go-grpc`
8486
ENV PATH $HOME/go/bin:$PATH
8587
RUN true \
86-
&& go get google.golang.org/grpc/cmd/protoc-gen-go-grpc \
88+
&& go get google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0 \
8789
&& go install google.golang.org/grpc/cmd/protoc-gen-go-grpc \
8890
google.golang.org/protobuf/cmd/protoc-gen-go \
8991
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
@@ -97,9 +99,6 @@ RUN git init && \
9799
git config --global --add safe.directory "*" && \
98100
rm -rf .git
99101

100-
# Download dependencies before copying the source so they will be cached
101-
RUN go mod download
102-
103102
# the ubi/go-toolset image doesn't define ENTRYPOINT or CMD, but we need it to run 'make develop'
104103
CMD /bin/bash
105104

0 commit comments

Comments
 (0)