Skip to content

Commit

Permalink
Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Oct 9, 2021
1 parent 2263edb commit 4582252
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#--------------------------------------------------------------------
# builder builds the binaries
#--------------------------------------------------------------------

FROM golang:1.17-alpine AS builder

# Ensure we're doing the right thing for Go
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64

# Copy our app
RUN mkdir -p /src
WORKDIR /src
COPY . .

# Build
RUN go mod download
RUN go build -o /protoc-gen-go-json .

#--------------------------------------------------------------------
# copy the built static binary to a scratch image
#--------------------------------------------------------------------

FROM scratch

COPY --from=builder /protoc-gen-go-json /protoc-gen-go-json

ENTRYPOINT ["/protoc-gen-go-json"]

0 comments on commit 4582252

Please sign in to comment.