-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleaned up dockerfile, moved create test #50
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Dockerfile | ||
README.md | ||
.history | ||
.travis.yml | ||
.gitignore | ||
.git | ||
test |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
main-packr.go | ||
packrd | ||
/commit0 | ||
.history/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
FROM golang:1.12.4-alpine3.9 as builder | ||
FROM golang:1.12.12-alpine3.10 as builder | ||
|
||
ENV GO111MODULE=on | ||
ENV GOLANG_PROTOBUF_VERSION=1.3.1 | ||
ENV GRPC_GATEWAY_VERSION=1.11.3 | ||
ENV GRPC_WEB_VERSION=1.0.6 | ||
ENV PROTOBUF_VERSION=3.9.2 | ||
ENV PROTOBUF_VERSION=3.6.1 | ||
|
||
RUN apk add --update --no-cache build-base curl git upx && \ | ||
rm -rf /var/cache/apk/* | ||
|
@@ -20,14 +20,11 @@ RUN curl -sSL \ | |
-o /usr/local/bin/protoc-gen-grpc-gateway && \ | ||
curl -sSL \ | ||
https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v${GRPC_GATEWAY_VERSION}/protoc-gen-swagger-v${GRPC_GATEWAY_VERSION}-linux-x86_64 \ | ||
-o /usr/local/bin/protoc-gen-swagger && \ | ||
chmod +x /usr/local/bin/protoc-gen-grpc-gateway && \ | ||
chmod +x /usr/local/bin/protoc-gen-swagger | ||
-o /usr/local/bin/protoc-gen-swagger | ||
|
||
RUN curl -sSL \ | ||
https://github.com/grpc/grpc-web/releases/download/${GRPC_WEB_VERSION}/protoc-gen-grpc-web-${GRPC_WEB_VERSION}-linux-x86_64 \ | ||
-o /usr/local/bin/protoc-gen-grpc-web && \ | ||
chmod +x /usr/local/bin/protoc-gen-grpc-web | ||
-o /usr/local/bin/protoc-gen-grpc-web | ||
|
||
RUN mkdir -p /tmp/protoc && \ | ||
curl -sSL \ | ||
|
@@ -39,24 +36,24 @@ RUN mkdir -p /tmp/protoc && \ | |
|
||
RUN GO111MODULE=off go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway | ||
|
||
RUN chmod +x /usr/local/bin/* && \ | ||
upx --lzma /usr/local/bin/* | ||
|
||
WORKDIR tmp/commit0 | ||
COPY . . | ||
RUN make build-deps && make build && \ | ||
mv commit0 /usr/local/bin | ||
RUN upx --lzma /usr/local/bin/* | ||
mv commit0 /usr/local/bin && \ | ||
upx --lzma /usr/local/bin/commit0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Separating this into two steps means most of the time we only need to re-compress the commit0 binary, not the other stuff that never changes. |
||
|
||
FROM alpine:edge | ||
FROM alpine:3.10 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Edge is the dev version, we should pin to a stable version. |
||
ENV \ | ||
PROTOTOOL_PROTOC_BIN_PATH=/usr/bin/protoc \ | ||
PROTOTOOL_PROTOC_WKT_PATH=/usr/local/include \ | ||
PROTOBUF_VERSION=3.9.2 \ | ||
ALPINE_PROTOBUF_VERSION_SUFFIX=r0 \ | ||
PROTOBUF_VERSION=3.6.1-r1 \ | ||
GOPATH=/proto-libs | ||
RUN mkdir ${GOPATH} | ||
COPY --from=builder /usr/local/bin /usr/local/bin | ||
COPY --from=builder /usr/local/include /usr/local/include | ||
COPY --from=builder /go/src/github.com/grpc-ecosystem/grpc-gateway ${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway | ||
WORKDIR /project | ||
RUN apk add --update --no-cache make protobuf=${PROTOBUF_VERSION}-${ALPINE_PROTOBUF_VERSION_SUFFIX} && \ | ||
RUN apk add --update --no-cache make protobuf=${PROTOBUF_VERSION} && \ | ||
rm -rf /var/cache/apk/* | ||
ENTRYPOINT ["commit0"] | ||
ENTRYPOINT ["/usr/local/bin/commit0"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package main | ||
package cmd_test | ||
|
||
import ( | ||
"github.com/commitdev/commit0/cmd" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make sure to make this file as strict as possible, otherwise all this stuff gets included in
COPY . .
and busts the cache for all sorts of changes to various files.