add Makefile and Dockerfile

This commit is contained in:
mischief 2015-07-18 20:55:52 -07:00
parent 3e103ee7ef
commit 8244fc3212
2 changed files with 23 additions and 0 deletions

7
Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM scratch
MAINTAINER Nick Owens <mischief@offblast.org>
ADD bin/gowerc /gowerc
ENTRYPOINT ["/gowerc"]

16
Makefile Normal file
View File

@ -0,0 +1,16 @@
P=gowerc
SRC=bitbucket.org
USER?=mischief
all: $(USER)/$(P)
$(USER)/$(P): bin/$(P)
docker build -t "$(USER)/$(P):latest" .
bin/$(P): *.go
docker run --rm -v ${PWD}:/go/src/$(SRC)/$(USER)/$(P) golang:1.4 /bin/bash -c "go list -f '{{range .Imports}}{{printf \"%s\n\" .}}{{end}}' $(SRC)/$(USER)/$(P) | xargs go get -d; CGO_ENABLED=0 go build -v -installsuffix cgo -o /go/src/$(SRC)/$(USER)/$(P)/bin/$(P) $(SRC)/$(USER)/$(P)"
clean:
docker run --rm -v ${PWD}:/opt busybox rm /opt/bin/$(P)
docker rmi "$(USER)/$(P):latest"