Skip to content

Commit

Permalink
feat: fix the CI dockerhub release error (#118)
Browse files Browse the repository at this point in the history
Because of this project is using golang version 1.19, We should choice a good versions for packages.

Changes:
- Changed version of google.golang.org/protobuf/cmd/protoc-gen-go from @latest to @v1.28.0
- Changed version of google.golang.org/protobuf/cmd/protoc-gen-go from @latest to @v1.2.0
- Download modules with `go mod download` command instead of downloading packages with latest versions like: "RUN go get google.golang.org/grpc"
  • Loading branch information
ali-shokoohi authored Oct 1, 2024
1 parent 3874663 commit 8d65648
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ ENV GO111MODULE=on \
GOOS=linux \
GOARCH=amd64

# Get grpc
RUN go get google.golang.org/grpc
# Download dependencies
RUN go mod download

# Install protoc-gen-go
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.0
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0

# Copy the source and generate the .proto file
ADD . /go/src/github.com/casbin/casbin-server
Expand All @@ -40,9 +40,6 @@ RUN protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=require_unimplemented_servers=false \
--go-grpc_opt=paths=source_relative proto/casbin.proto

# Download dependencies
RUN go mod download

# Install app
RUN go install .

Expand Down

0 comments on commit 8d65648

Please sign in to comment.