Skip to content

Commit 9bc9aff

Browse files
committed
Mount with :U to fix Podman runs on Ubuntu.
"Tells Podman to recursively chown the volume to match the default user found inside the user namespaced container." https://www.redhat.com/en/blog/container-permission-denied-errors
1 parent f67aa2d commit 9bc9aff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc_builder/build_commands.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def get_build_command(
125125
# Mount the user's home directory in the container; this assumes that both
126126
# run_from_dir and build_dir reside somewhere under the user's home directory (we
127127
# check this assumption below).
128-
container_mountpoint = os.path.expanduser("~")
128+
container_mountpoint = os.path.realpath(os.pardir)
129129

130130
errmsg_if_not_under_mountpoint = "build_docs must be run from somewhere in your home directory"
131131
container_workdir = _container_path_from_local_path(
@@ -167,8 +167,8 @@ def get_build_command(
167167
container_name,
168168
"--user",
169169
f"{uid}:{gid}",
170-
"--mount",
171-
f"type=bind,source={container_mountpoint},target={_CONTAINER_HOME}",
170+
"-v",
171+
f"{container_mountpoint}:{_CONTAINER_HOME}:U",
172172
"--workdir",
173173
container_workdir,
174174
"-t", # "-t" is needed for colorful output

0 commit comments

Comments
 (0)