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.
This commit is contained in:
Aravindh Puthiyaparambil 2023-03-20 12:29:47 -07:00
parent 738e1313bf
commit a61f8b7035
No known key found for this signature in database
GPG Key ID: 2281DA6B582F6AA6
1 changed files with 3 additions and 1 deletions

View File

@ -9,7 +9,9 @@ CONTAINER_ENGINE ?= docker
IMAGE_REGISTRY ?= gcr.io/k8s-staging-sig-docs
IMAGE_VERSION=$(shell scripts/hash-files.sh Dockerfile Makefile | cut -c 1-12)
CONTAINER_IMAGE = $(IMAGE_REGISTRY)/k8s-website-hugo:v$(HUGO_VERSION)-$(IMAGE_VERSION)
CONTAINER_RUN = "$(CONTAINER_ENGINE)" run --rm --interactive --tty --volume "$(CURDIR):/src"
# Mount read-only to allow use with tools like Podman in SELinux mode
# Container targets don't need to write into /src
CONTAINER_RUN = "$(CONTAINER_ENGINE)" run --rm --interactive --tty --volume "$(CURDIR):/src:ro,Z"
CCRED=\033[0;31m
CCEND=\033[0m