diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..19def7e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM golang:1.9.0 as builder +WORKDIR /go/src/github.com/moooofly/harbor-go-client +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -a + +# Final image. +FROM scratch +LABEL maintainer "moooofly " +COPY --from=builder /go/src/github.com/moooofly/harbor-go-client/harbor-go-client . +COPY conf /conf +ENTRYPOINT ["/harbor-go-client"] +CMD ["-h"] diff --git a/Makefile b/Makefile index 8cb3aa2..a5a3e00 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,9 @@ pack: build @echo "" @rm harbor-go-client +docker: + docker build -t harbor-go-client:$(shell git rev-parse --short HEAD) . + misspell: # misspell - requires that the following be run first: # go get -u github.com/client9/misspell/cmd/misspell