diff --git a/Dockerfile b/Dockerfile index c6d71b2..8f11c7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,19 @@ -FROM golang:1.12-alpine - -WORKDIR /etc -ADD . . -RUN apk update && \ - apk add git make clang build-base pkgconfig openssh cmake libssh2 libssh2-dev openssl bash ninja -RUN go get -u -d -v . -RUN ./install.sh -RUN ./gitql -v -RUN echo "INSTALLED " $TARGET_OS_ARCH +# run with: +# docker build -t gitql . +# docker run -it --entrypoint /bin/sh gitql:latest + +FROM golang:1.15.2-alpine3.12 as builder + +WORKDIR /src +COPY go.mod . +COPY go.sum . +RUN go mod download + +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -o /bin/gitql + +FROM alpine:3.12 +RUN apk add -U git +COPY --from=builder /bin/gitql /bin/ + +ENTRYPOINT ["gitql"] \ No newline at end of file