-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from moul/dev/moul/update-web-editor
- Loading branch information
Showing
7 changed files
with
168 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Dockerfile | ||
*~ | ||
.git/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
FROM znly/protoc:0.3.0 | ||
# 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 | ||
|
||
ENV GOPATH=/go \ | ||
PATH=/go/bin:${PATH} | ||
|
||
# Install deps and common tools | ||
RUN apk --update add make git go rsync libc-dev \ | ||
&& go get -u golang.org/x/tools/cmd/goimports | ||
|
||
# Install protoc-gen-gotemplate | ||
COPY . /go/src/moul.io/protoc-gen-gotemplate | ||
WORKDIR /go/src/moul.io/protoc-gen-gotemplate | ||
RUN git remote set-url origin https://github.com/moul/protoc-gen-gotemplate | ||
RUN go install . ./cmd/web-editor | ||
# 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 [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.