bwrap Project Atomic Developer Alexander Larsson Developer Colin Walters bwrap 1 User Commands bwrap container setup utility bwrap OPTION COMMAND Description bwrap is a privileged helper for container setup. You are unlikely to use it directly from the commandline, although that is possible. It works by creating a new, completely empty, filesystem namespace where the root is on a tmpfs that is invisible from the host, and which will be automatically cleaned up when the last process exists. You can then use commandline options to construct the root filesystem and process environment for the command to run in the namespace. By default, bwrap creates a new user namespace for the sandbox. Optionally it also sets up new ipc, pid, network and uts namespaces. The application in the sandbox can be made to run with a different UID and GID. If needed (e.g. when using a PID namespace) bwrap is running a minimal pid 1 process in the sandbox that is responsible for reaping zombies. It also detects when the initial application process (pid 2) dies and reports its exit status back to the original spawner. The pid 1 process exits to clean up the sandbox when there are no other processes in the sandbox left. Options When options are used multiple times, the last option wins, unless otherwise specified. General options: Print help and exit Print version Parse nul-separated arguments from the given file descriptor. This option can be used multiple times to parse options from multiple sources. Options related to kernel namespaces: Create a new user namespace Create a new user namespace if possible else skip it Create a new ipc namespace Create a new pid namespace Create a new network namespace Create a new uts namespace Create a new cgroup namespace Create a new cgroup namespace if possible else skip it Use a custom user id in the sandbox (requires ) Use a custom group id in the sandbox (requires ) Use a custom hostname in the sandbox (requires ) Options about environment setup: Change directory to DIR Set an environment variable Unset an environment variable Options for monitoring the sandbox from the outside: Take a lock on DEST while the sandbox is running. This option can be used multiple times to take locks on multiple files. Keep this file descriptor open while the sandbox is running Filesystem related options. These are all operations that modify the filesystem directly, or mounts stuff in the filesystem. These are applied in the order they are given as arguments. Any missing parent directories that are required to create a specified destination are automatically created as needed. Bind mount the host path SRC on DEST Bind mount the host path SRC on DEST, allowing device access Bind mount the host path SRC readonly on DEST Remount the path DEST as readonly. It works only on the specified mount point, without changing any other mount point under the specified path Mount procfs on DEST Mount new devtmpfs on DEST Mount new tmpfs on DEST Mount new mqueue on DEST Create a directory at DEST Copy from the file descriptor FD to DEST Copy from the file descriptor FD to a file which is bind-mounted on DEST Copy from the file descriptor FD to a file which is bind-mounted readonly on DEST Create a symlink at DEST with target SRC Lockdown options: Load and use seccomp rules from FD. The rules need to be in the form of a compiled eBPF program, as generated by seccomp_export_bpf. Exec Label from the sandbox. On an SELinux system you can specify the SELinux context for the sandbox process(s). File label for temporary sandbox content. On an SELinux system you can specify the SELinux context for the sandbox content. Block the sandbox on reading from FD until some data is available. Write information in JSON format about the sandbox to FD. Environment HOME Used as the cwd in the sandbox if has not been explicitly specified and the current cwd is not present inside the sandbox. The option can be used to override the value that is used here. Exit status The bwrap command returns the exit status of the initial application process (pid 2 in the sandbox).