Skip to content

Commit

Permalink
New syntax for custom docker run options (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Jul 11, 2018
1 parent b74bcb3 commit 68abd3c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
21 changes: 17 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,32 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
Project website: https://github.com/mviereck/x11docker

## [Unreleased]
### Changed
- Adjustments to support [MSYS2/CYGWIN/MINGW](https://www.msys2.org/).
### Added
- Support of [MSYS2/CYGWIN/MINGW](https://www.msys2.org/).
[(#55)](https://github.com/mviereck/x11docker/issues/55)
### Changed
- Syntax changed for custom `DOCKER_RUN_OPTIONS`:
Previous, still valid:
x11docker [OPTIONS] -- "[DOCKER_RUN_OPTIONS]" IMAGE [COMMAND [ARG1 ARG2 ...]]
New:
x11docker [OPTIONS] -- DOCKER_RUN_OPTIONS -- IMAGE [COMMAND [ARG1 ARG2 ...]]
BREAKS due to wrongly parsed -- :
x11docker [OPTIONS] -- "DOCKER_RUN_OPTIONS" IMAGE COMMAND ARG1 -- ARG2
Valid:
x11docker [OPTIONS] -- "DOCKER_RUN_OPTIONS" -- IMAGE COMMAND ARG1 -- ARG2
x11docker [OPTIONS] -- IMAGE COMMAND ARG1 -- ARG2
[(#58)](https://github.com/mviereck/x11docker/issues/58)
### Fixed
- `--xpra`: Support of outdated xpra version v0.17.6 that is still
distributed in debian stretch and buster.
- `--pw gksu`, `--pw gksudo`: Disable keyboard grabbing to avoid issues
with Gnome 3 Wayland session.
- `--xpra`: Check if `xhost` is available if xpra version 2.3.1 has cookie
issue. [(#57)](https://github.com/mviereck/x11docker/issues/57)
- `--xpra-xwayland`: Set Weston `--fullscreen` to get Xwayland resolution
matching host display. Weston v4.0.0 seems to interpret screen size
settings in `weston.ini` different than before.
- `--pw gksu`, `--pw gksudo`: Disable keyboard grabbing to avoid issues
with Gnome 3 Wayland session.
- Don't fail on missing password prompt frontend if no password is needed.

## [4.3.6](https://github.com/mviereck/x11docker/releases/tag/v4.3.6) - 2018-07-03
### Changed
Expand Down
18 changes: 14 additions & 4 deletions x11docker
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Type 'x11docker --help' or scroll down to read usage information.
# More documentation at: https://github.com/mviereck/x11docker

Version="4.3.7-beta"
Version="5.0.0-beta"

usage() { # --help: show usage information
echo "
Expand All @@ -19,7 +19,8 @@ x11docker: Run GUI applications and desktop environments in docker.
Usage:
To run a docker image with new X server (auto-choosing X server):
x11docker [OPTIONS] IMAGE [COMMAND]
x11docker [OPTIONS] -- "'"[DOCKER_RUN_OPTIONS]"'" IMAGE [COMMAND [ARG1 ARG2 ...]]
x11docker [OPTIONS] -- IMAGE [COMMAND [ARG1 ARG2 ...]]
x11docker [OPTIONS] -- DOCKER_RUN_OPTIONS -- IMAGE [COMMAND [ARG1 ARG2 ...]]
To run a host application on a new X server:
x11docker [OPTIONS] --exe COMMAND
x11docker [OPTIONS] --exe -- COMMAND [ARG1 ARG2 ...]
Expand Down Expand Up @@ -746,7 +747,7 @@ storepid () { # store pid $1 and name $2 of background process in file
checkpid() { # check if PID $1 is active
ps -p ${1:-} >/dev/null 2>&1
}
pspid() { # ps -p --no-headers $1
pspid() { # ps -p $1 --no-headers
ps -p ${1:-} | tail -n+2
}
no_xhost() { # remove any access to X server granted by xhost
Expand Down Expand Up @@ -1645,6 +1646,13 @@ $Customenvironment" ; shift ;; # set custom environm

##### custom docker options / image name + image command
--) shift
[ "$(cut -c1 <<< "${1:-}")" = "-" ] && grep -q " -- " <<< "$*" && {
Customdockeroptions="$(sed 's/ -- .*//' <<< "$*" )"
Imagecommand="$(sed -n 's/^.* -- //p' <<< "$*" )"
Imagename="$(cut -d ' ' -f1 <<< "$Imagecommand")"
Imagecommand="$(cut -d ' ' -f2 -s <<< "$Imagecommand")"
break
}
while [ $# -gt 0 ] ; do
[ -n "${1:-}" ] && [ -z "$Imagename" ] && [ "$(echo "${1:-}" | cut -c1)" = "-" ] && Customdockeroptions="$Customdockeroptions ${1:-}"
[ -n "${1:-}" ] && [ -z "$Imagename" ] && [ "$(echo "${1:-}" | cut -c1)" != "-" ] && Imagename="${1:-}" && shift
Expand Down Expand Up @@ -3756,7 +3764,9 @@ done
*) error "Unknown password prompt '$Passwordfrontend' (option --pw).
Possible: su sudo gksu gksudo lxsu lxsudo kdesu kdesudo beesu pkexec none" ;;
esac
command -v $(echo $Passwordcommand|cut -d' ' -f1) >/dev/null || error "Password prompt frontend $(echo $Passwordcommand|cut -d' ' -f1) not found"
[ "$Passwordneeded" = "yes" ] && {
command -v $(echo $Passwordcommand|cut -d' ' -f1) >/dev/null || error "Password prompt frontend $(echo $Passwordcommand|cut -d' ' -f1) not found"
}
}

{ #### part: check terminal for password prompt of su or sudo and for 'docker pull'
Expand Down

0 comments on commit 68abd3c

Please sign in to comment.