Skip to content

Commit

Permalink
feat: add Dockerfile and 'make docker' sub-command
Browse files Browse the repository at this point in the history
  • Loading branch information
moooofly committed Jul 4, 2018
1 parent 69932e0 commit c1029c4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <centos.sf@gmail.com>"
COPY --from=builder /go/src/github.com/moooofly/harbor-go-client/harbor-go-client .
COPY conf /conf
ENTRYPOINT ["/harbor-go-client"]
CMD ["-h"]
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c1029c4

Please sign in to comment.