Skip to content

Commit

Permalink
Merge pull request #8 from weaveworks/build-on-osx
Browse files Browse the repository at this point in the history
Don't call `sudo docker` when building on macOS
  • Loading branch information
awh committed Jun 5, 2018
2 parents fd752b8 + 0e75f74 commit aefc4ea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

DH_ORG=weaveworks
VERSION=$(shell git symbolic-ref --short HEAD)-$(shell git rev-parse --short HEAD)
SUDO=$(shell docker info >/dev/null 2>&1 || echo "sudo -E")

all: image

Expand All @@ -22,13 +23,13 @@ cmd/kured/kured: cmd/kured/*.go
build/.image.done: cmd/kured/Dockerfile cmd/kured/kured
mkdir -p build
cp $^ build
sudo -E docker build -t quay.io/$(DH_ORG)/kured:$(VERSION) -f build/Dockerfile ./build
$(SUDO) docker build -t quay.io/$(DH_ORG)/kured:$(VERSION) -f build/Dockerfile ./build
touch $@

image: build/.image.done

publish-image: image
sudo -E docker push quay.io/$(DH_ORG)/kured:$(VERSION)
$(SUDO) docker push quay.io/$(DH_ORG)/kured:$(VERSION)

minikube-publish: image
sudo -E docker save quay.io/$(DH_ORG)/kured:$(VERSION) | (eval $$(minikube docker-env) && docker load)
$(SUDO) docker save quay.io/$(DH_ORG)/kured:$(VERSION) | (eval $$(minikube docker-env) && docker load)

0 comments on commit aefc4ea

Please sign in to comment.