Skip to content

Commit

Permalink
Allow host shared memory
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensa committed Feb 4, 2020
1 parent cbaf957 commit 268e729
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ prepare_docker_printer_host_sharing() {
ENV_VARS+=" --env CUPS_SERVER=/run/cups/cups.sock"
}
prepare_docker_ipc_host_sharing() {
# Allow shared memory to avoid RAM access failures and rendering glitches due to X extesnion MIT-SHM
EXTRA+=" --ipc=host"
}
prepare_docker_x11_host_sharing() {
# X11 Unix-domain socket
MOUNTS+=" --mount type=bind,source=/tmp/.X11-unix,target=/tmp/.X11-unix"
Expand Down Expand Up @@ -151,6 +156,7 @@ prepare_docker_sound_host_sharing
prepare_docker_webcam_host_sharing
prepare_docker_gpu_host_sharing
prepare_docker_printer_host_sharing
prepare_docker_ipc_host_sharing
prepare_docker_x11_host_sharing
prepare_docker_hostname_host_sharing
prepare_docker_nvidia_drivers_install
Expand All @@ -171,7 +177,7 @@ docker run --rm -it \

This way, the internal user UID an group GID are changed to the current host user:group launching the container and the existing files under his internal HOME directory that where owned by user and group are also updated to belong to the new UID:GID.

Functions prepare_docker_dbus_host_sharing, prepare_docker_xdg_runtime_dir_host_sharing, prepare_docker_sound_host_sharing, prepare_docker_webcam_host_sharing, prepare_docker_gpu_host_sharing, prepare_docker_printer_host_sharing, prepare_docker_x11_host_sharing and prepare_docker_hostname_host_sharing allows sharing your host resources with the running container as GUI apps can interact with your host system as they where installed in the host.
Functions prepare_docker_dbus_host_sharing, prepare_docker_xdg_runtime_dir_host_sharing, prepare_docker_sound_host_sharing, prepare_docker_webcam_host_sharing, prepare_docker_gpu_host_sharing, prepare_docker_printer_host_sharing, prepare_docker_ipc_host_sharing, prepare_docker_x11_host_sharing and prepare_docker_hostname_host_sharing allows sharing your host resources with the running container as GUI apps can interact with your host system as they where installed in the host.

Function prepare_docker_nvidia_drivers_install allows the nvidia drivers host version to be installed on container.

Expand Down
6 changes: 6 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ prepare_docker_printer_host_sharing() {
ENV_VARS+=" --env CUPS_SERVER=/run/cups/cups.sock"
}

prepare_docker_ipc_host_sharing() {
# Allow shared memory to avoid RAM access failures and rendering glitches due to X extesnion MIT-SHM
EXTRA+=" --ipc=host"
}

prepare_docker_x11_host_sharing() {
# X11 Unix-domain socket
MOUNTS+=" --mount type=bind,source=/tmp/.X11-unix,target=/tmp/.X11-unix"
Expand Down Expand Up @@ -107,6 +112,7 @@ prepare_docker_sound_host_sharing
prepare_docker_webcam_host_sharing
prepare_docker_gpu_host_sharing
prepare_docker_printer_host_sharing
prepare_docker_ipc_host_sharing
prepare_docker_x11_host_sharing
prepare_docker_hostname_host_sharing
prepare_docker_nvidia_drivers_install
Expand Down

0 comments on commit 268e729

Please sign in to comment.