Skip to content

Commit a61f8b7

Browse files
committed
Fix container-serve on SELinux systems
`make container-serve` fails with "Error: open : no such file or directory" on SELinux enabled systems. Fix this by adding the `ro,Z` suffix to the volume mount to label the content with a read only private unshared label.
1 parent 738e131 commit a61f8b7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ CONTAINER_ENGINE ?= docker
99
IMAGE_REGISTRY ?= gcr.io/k8s-staging-sig-docs
1010
IMAGE_VERSION=$(shell scripts/hash-files.sh Dockerfile Makefile | cut -c 1-12)
1111
CONTAINER_IMAGE = $(IMAGE_REGISTRY)/k8s-website-hugo:v$(HUGO_VERSION)-$(IMAGE_VERSION)
12-
CONTAINER_RUN = "$(CONTAINER_ENGINE)" run --rm --interactive --tty --volume "$(CURDIR):/src"
12+
# Mount read-only to allow use with tools like Podman in SELinux mode
13+
# Container targets don't need to write into /src
14+
CONTAINER_RUN = "$(CONTAINER_ENGINE)" run --rm --interactive --tty --volume "$(CURDIR):/src:ro,Z"
1315

1416
CCRED=\033[0;31m
1517
CCEND=\033[0m

0 commit comments

Comments
 (0)