Skip to content

Commit 32369a3

Browse files
committed
BUG: Bind-mount even more files for better OOTBE
1 parent 13f8020 commit 32369a3

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ process invocations via **`$BWRAP_ARGS` environment variable**. E.g.:
7777

7878
```sh
7979
BWRAP_ARGS='--bind /opt /opt' \
80-
python -c 'import os; print(os.listdir("/opt"))'
80+
sandbox-run ./NVIDIA-Driver-Installer.run
8181
```
8282

8383
For details, see `bubblewrap --help` or [`man 1 bwrap`](https://manpages.debian.org/unstable/bwrap).
@@ -104,6 +104,7 @@ is lost upon container termination.
104104

105105
See `bwrap` switches [`--seccomp FD` and `--add-seccomp-fd FD`](https://manpages.debian.org/unstable/bubblewrap/bwrap.1.en.html#:~:text=Lockdown%20options%3A-,--seccomp%20fd,-Load%20and%20use).
106106

107+
107108
#### Runtime monitoring
108109

109110
If **environment variable `VERBOSE=`** is set to a non-empty value,

sandbox-run

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,21 @@ paths='
4545
/etc/ssl
4646
/etc/hosts
4747
/etc/pki
48+
/etc/pkcs11
4849
/etc/ld.so.cache
50+
/etc/ld.so.conf.d
4951
/etc/localtime
50-
/etc/mtab
5152
/etc/os-release
5253
/etc/timezone
5354
/lib
5455
/lib64
5556
/run/dbus/system_bus_socket
5657
/usr
5758
'
59+
# ld.so.conf.d: https://containertoolbx.org/doc/#ldconfig8
60+
RW_paths='
61+
/etc/ld.so.conf.d
62+
'
5863

5964
# Support BWRAP_ARGS passed to the process as well as via .env file
6065
prev_BWRAP_ARGS="${BWRAP_ARGS:-}"
@@ -97,16 +102,18 @@ warn "exec bwrap [...] $formatted_cmdline"
97102

98103
# shellcheck disable=SC2046
99104
bwrap \
100-
--dir /tmp \
105+
--tmpfs /tmp \
101106
--tmpfs /run \
102107
--proc /proc \
103108
--dev /dev \
109+
--symlink /run /var/run \
104110
--symlink /tmp /var/tmp \
105111
--symlink /usr/bin /bin \
106112
--symlink /usr/bin /sbin \
107113
--dev-bind-try /dev/fuse /dev/fuse \
108114
--ro-bind "$bin" "$bin" \
109115
$(set +x; for path in $paths; do [ ! -e "$path" ] || printf -- '--ro-bind-try %s %s ' "$path" "$path"; done) \
116+
$(set +x; for path in $RW_paths; do [ ! -e "$path" ] || printf -- '--bind-try %s %s ' "$path" "$path"; done) \
110117
--bind "$cwd" "$cwd" \
111118
--chdir "$cwd" \
112119
--clearenv \

0 commit comments

Comments
 (0)