Skip to content

Commit e318fd5

Browse files
committed
build: Fix docker command when selinux is enforced
The DOCKER command was missing :Z for the ~/go directory, failing with: $ BUILD_IN_DOCKER=y make all ... GOOS="linux" GOARCH="arm64" \ go build -tags "libvirt_dlopen" -ldflags="-X k8s.io/minikube/pkg/version.version=v1.37.0 ... go: could not create module cache: stat /go/pkg/mod: permission denied make: *** [Makefile:279: out/minikube-linux-arm64] Error 1 make: *** [Makefile:276: out/minikube-linux-arm64] Error 2 With this change we can debug build issues on Fedora or other distros using selinux.
1 parent 9ebf9fd commit e318fd5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ endef
188188

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

194194
ifeq ($(BUILD_IN_DOCKER),y)

0 commit comments

Comments
 (0)