Skip to content

Commit

Permalink
update Dockerfile (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowspore authored Oct 4, 2020
1 parent beebd12 commit 3e065e8
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 3e065e8

Please sign in to comment.