Skip to content

Commit

Permalink
Merge pull request #5818 from afbjorklund/docker-entrypoint
Browse files Browse the repository at this point in the history
Don't use bash as the entrypoint for docker
  • Loading branch information
tstromberg authored Dec 9, 2019
2 parents 83e9bfd + c668631 commit 92b646d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ HYPERKIT_LDFLAGS := -X k8s.io/minikube/pkg/drivers/hyperkit.version=$(VERSION) -

# $(call DOCKER, image, command)
define DOCKER
docker run --rm -e GOCACHE=/app/.cache -e IN_DOCKER=1 --user $(shell id -u):$(shell id -g) -w /app -v $(PWD):/app -v $(GOPATH):/go --entrypoint /bin/bash $(1) -c '$(2)'
docker run --rm -e GOCACHE=/app/.cache -e IN_DOCKER=1 --user $(shell id -u):$(shell id -g) -w /app -v $(PWD):/app -v $(GOPATH):/go --init $(1) /bin/bash -c '$(2)'
endef

ifeq ($(BUILD_IN_DOCKER),y)
Expand Down Expand Up @@ -435,7 +435,10 @@ out/minikube-installer.exe: out/minikube-windows-amd64.exe

out/docker-machine-driver-hyperkit:
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
$(call DOCKER,$(HYPERKIT_BUILD_IMAGE),CC=o64-clang CXX=o64-clang++ /usr/bin/make $@)
docker run --rm -e GOCACHE=/app/.cache -e IN_DOCKER=1 \
--user $(shell id -u):$(shell id -g) -w /app \
-v $(PWD):/app -v $(GOPATH):/go --init --entrypoint "" \
$(HYPERKIT_BUILD_IMAGE) /bin/bash -c 'CC=o64-clang CXX=o64-clang++ /usr/bin/make $@'
else
GOOS=darwin CGO_ENABLED=1 go build \
-ldflags="$(HYPERKIT_LDFLAGS)" \
Expand All @@ -444,7 +447,7 @@ endif

hyperkit_in_docker:
rm -f out/docker-machine-driver-hyperkit
$(call DOCKER,$(HYPERKIT_BUILD_IMAGE),CC=o64-clang CXX=o64-clang++ /usr/bin/make out/docker-machine-driver-hyperkit)
$(MAKE) MINIKUBE_BUILD_IN_DOCKER=y out/docker-machine-driver-hyperkit

.PHONY: install-hyperkit-driver
install-hyperkit-driver: out/docker-machine-driver-hyperkit ## Install hyperkit to local machine
Expand Down

0 comments on commit 92b646d

Please sign in to comment.