Skip to content

Commit

Permalink
copy containerrootrc to /tmp to circumvent 700 on host cache #131
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Feb 25, 2019
1 parent ee8f563 commit 5d69464
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

Project website: https://github.com/mviereck/x11docker

## [Unreleased]
### Changed
- `--wm[=COMMAND]`: Argument `COMMAND` is optional now.

## [5.4.4](https://github.com/mviereck/x11docker/releases/tag/v5.4.4) - 2019-02-24
### Fixed
- `--gpu`: NVIDIA driver installation: Avoid `--install-libglvnd` and
Expand Down
19 changes: 10 additions & 9 deletions x11docker
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ Basic settings: (especially influencing auto choosing X server)
on host and OpenGL/Mesa in image.
For closed source nvidia drivers regard terminal output.
Degrades container isolation. Container access to GPU.
-w, --wm COMMAND Host window manager to use for single applications in
nested X server options like --xephyr.
To autodetect a host wm, use --wm=auto or short: -wm
-w, --wm [=COMMAND] Use host window manager COMMAND for single applications
in nested X server options like --xephyr.
Without COMMAND autodetect a window manager.
To set default autodetected window manager:
update-alternatives --config x-window-manager
Expand Down Expand Up @@ -925,7 +925,7 @@ mkfile() { # create file $1 owned by $Hostuser
:> "${1:-}" || return 1
chown $Hostuser "${1:-}" || return 1
chgrp $Hostusergid "${1:-}" || return 1
chmod 666 "${1:-}" || return 1
chmod 644 "${1:-}" || return 1
[ -n "${2:-}" ] && { chmod ${2:-} "${1:-}" || return 1 ; }
return 0
}
Expand Down Expand Up @@ -4084,7 +4084,7 @@ create_dockerrc() { # create dockerrc: This script runs as root (or
echo " echo '# wait for container setup script do be ready'"
echo " echo 'Zeit=\$(date +%s)'"
echo " echo 'for Count in $(seq -s' ' 50); do'"
echo " echo ' verbose \"Waiting since \$((\$(date +%s) - \$Zeit))s for container setup to be ready\"'"
echo " echo ' verbose \"Waiting since \$((\$(date +%s) - \$Zeit))s for container root setup to be ready\"'"
echo " echo ' [ -e /x11docker.setupready ] && break'"
echo " echo ' sleep \$(awk \"BEGIN { print \$Count*0.2 }\")'"
echo " echo 'done'"
Expand Down Expand Up @@ -4314,7 +4314,8 @@ create_dockerrc() { # create dockerrc: This script runs as root (or
echo "echo \$Containerpid >> $Containerpidfile"
echo ""
# container.CMD.sh will wait until setup script is ready
[ "$Switchcontaineruser" = "no" ] && echo "$Dockerexe exec --tty -u root $Containername /bin/sh $Cshare/containerrootrc 2>&1 | rmcr >>$Containerlogfile"
[ "$Switchcontaineruser" = "no" ] && echo "$Dockerexe exec --tty $Containername sh -c 'cp $Cshare/containerrootrc /tmp/containerrootrc ; chmod 644 /tmp/containerrootrc' 2>&1 | rmcr >>$Containerlogfile"
[ "$Switchcontaineruser" = "no" ] && echo "$Dockerexe exec --tty -u root $Containername /bin/sh /tmp/containerrootrc 2>&1 | rmcr >>$Containerlogfile"
echo "exit 0"
return 0
} >> $Dockerrc
Expand Down Expand Up @@ -6508,7 +6509,7 @@ parse_options() { # parse cli options
Shortoptions="aAbcdDefgGhHiKl:mMnNopPqQrstTuv::w:WxXyY"
Longoptions="auto,x,X,xpra,xephyr,x11,xorg,hostdisplay,xwayland,weston-xwayland,xpra-xwayland,nxagent,wayland" # X servers
Longoptions="$Longoptions,weston,hostwayland,kwin,kwin-xwayland,xdummy,xvfb,no-x,vcxsrv,xwin,tty" # more X/Wayland servers
Longoptions="$Longoptions,wm:,desktop,exe,xonly"
Longoptions="$Longoptions,wm::,desktop,exe,xonly"
Longoptions="$Longoptions,fullscreen,size:,scale:,rotate:,dpi:,output-count:,gpu,xfishtank,border::" # X appearance options
Longoptions="$Longoptions,xhost:,no-auth,vt:,display:,env:,showenv,showid,showpid1" # X and environment options
Longoptions="$Longoptions,home,clipboard,pulseaudio::,alsa::,lang:,printer,webcam" # comfort options
Expand Down Expand Up @@ -6569,8 +6570,8 @@ parse_options() { # parse cli options
-d|--desktop) Desktopmode="yes" ;; # image contains a desktop environment.
-g|--gpu) Sharegpu="yes" ;; # share files in /dev/dri, allow GPU usage
-w|--wm) case ${2:-} in # choose host window manager
""|"n"|"none") Windowmanager="none" ;;
"m"|"auto") Windowmanager="auto" ;;
"n"|"none") Windowmanager="none" ;;
""|"m"|"auto") Windowmanager="auto" ;;
*) Windowmanager=${2:-} ;;
esac
shift
Expand Down

0 comments on commit 5d69464

Please sign in to comment.