19 lines
646 B
Docker
Raw Permalink Normal View History

2020-05-20 13:22:18 +02:00
# builder
FROM golang:1.14-alpine as builder
RUN apk --no-cache add make git go rsync libc-dev
RUN go get -u golang.org/x/tools/cmd/goimports
RUN go get -u github.com/gobuffalo/packr/v2/packr2
COPY . /go/src/moul.io/protoc-gen-gotemplate
WORKDIR /go/src/moul.io/protoc-gen-gotemplate
RUN packr2
RUN go install -a -tags netgo -ldflags '-w -extldflags "-static"' . ./cmd/web-editor
RUN ls -la /go/bin
2017-10-10 10:58:05 +02:00
2020-05-20 13:22:18 +02:00
# runtime
FROM znly/protoc:0.3.0
COPY --from=builder /go/bin/web-editor /go/bin/
COPY --from=builder /go/bin/protoc-gen-gotemplate /go/bin/
ENV PATH=$PATH:/go/bin
EXPOSE 8080
ENTRYPOINT []