Closed eine closed 5 years ago
Two bugs come together here, one in x11docker and one in x11docker/xfce image.
https://github.com/mviereck/x11docker/commit/8d30aa4d94ed2a2694d083dc8ef4a875326b4bd8 fixes the bug in x11docker. The quotes around "ls && pwd"
are now preserved accurately. The fix also preserves quotes in DOCKER_RUN_OPTIONS
.
The fix changes the generated docker command and the image command in x11docker.CMD.sh
. My first tests show now issues.
Image x11docker/xfce
contains an ENTRYPOINT
script that eats up the quotes (same goes for x11docker/lxde
). I'll remove that script, it copies files from /etc/skel
to HOME
. But this has to wait until I push the next x11docker release that does the copy on itself.
Meanwhile you can test e.g.
x11docker -ti -- x11docker/fvwm sh -c "ls -la ; pwd ; sh"
x11docker -i -t x11docker/xfce bash -c "ls && bash" with the note about --clipboard.
The -c
is parsed as clipboard option and not used as part of the image command. The correct syntax uses --
to divide x11docker options from image command options:
x11docker -i -t -- x11docker/xfce bash -c "ls && bash"
./x11docker -i -t x11docker/xfce ls: does not show the output of ls.
Note that ls
in empty HOME
does not show any output. Rather check with ls -la
I pulled the latest master and I tried:
# ./x11docker -ti -- x11docker/fvwm sh -c "ls -la ; pwd ; sh"
...
Image 'sh' not found locally.
Do you want to pull it from docker hub? [Y|n]
(Will wait up to 60s for a response, otherwise assuming no)y
/c/Users/eine/x11docker/cache/sh-42d07a/dockerrc: line 123: notify-send: command not found
Using default tag: latest
x11docker note: Pulling image sh from docker hub
Error response from daemon: pull access denied for sh, repository does not exist or may require 'docker login'
x11docker ERROR: Did not find image sh.
Please build image first or pull it from docker hub with:
docker pull sh
or run x11docker with option --pull=yes
Type 'x11docker --help' for usage information
Debug options: '--verbose' (full log) or '--debug' (log excerpt).
Logfile will be: /c/Users/eine/x11docker/cache/x11docker.log
Please report issues at https://github.com/mviereck/x11docker
./x11docker: line 448: /c/Users/eine/x11docker/cache/sh-42d07a/message.log: No such file or directory
./x11docker: line 448: /c/Users/eine/x11docker/cache/sh-42d07a/message.log: No such file or directory
./x11docker: line 448: /c/Users/eine/x11docker/cache/sh-42d07a/message.log: No such file or directory
./x11docker: line 448: /c/Users/eine/x11docker/cache/sh-42d07a/message.log: No such file or directory
But this has to wait until I push the next x11docker release that does the copy on itself.
I'll try with other images meanwhile.
Meanwhile you can test e.g.
x11docker -ti -- x11docker/fvwm sh -c "ls -la ; pwd ; sh"
I tried, but it fails as shown above. I think that this is related to the fix, rather than to the image. The same happens with x11docker -i -t -- x11docker/xfce bash -c "ls && bash"
.
The correct syntax uses
--
to divide x11docker options from image command options:
I always forget about it when I don't put docker run options. Thanks for the remainder.
I tried, but it fails as shown above. I think that this is related to the fix, rather than to the image. The same happens with x11docker -i -t -- x11docker/xfce bash -c "ls && bash".
Stupid me, I should have tested without DOCKER_RUN_OPTIONS
, too. Is fixed now.
It works great now! I believe we can close this too.
I am trying to execute
winpty docker run --rm -it x11docker/xfce bash -c "ls && pwd"
with x11docker../x11docker -i -t x11docker/xfce bash
: works, but it not what I want../x11docker -i -t x11docker/xfce ls
: does not show the output ofls
../x11docker -i -t x11docker/xfce ls && pwd
: the output from x11docker is shown and thenpwd
is executed in the host. The output ofls
is not shown../x11docker -i -t x11docker/xfce bash -c "ls && pwd"
:-c
is considered to be the option--clipboard
of x11docker, so a warning is shown:./x11docker -i -t x11docker/xfce "ls && bash"
: as used in #110,ls
is not executed at first, but a bash is provided. After exiting,ls
is executed, which shows nothing.However, in neither case is a command prompt provided after. The container exists instead. This is different from the results reported in #110.
./x11docker -i -t x11docker/xfce bash "ls && bash"
: as in the previous case,ls
is not executed at first, but a bash is provided. After exiting,ls
is executed, but it fails now../x11docker -i -t x11docker/xfce bash "ls && pwd && bash"
: same as the previous case../x11docker -i -t x11docker/xfce bash "ls; pwd; bash"
: same as the previous case../x11docker -i -t x11docker/xfce bash -c "ls && bash"
: same as the case without-c
, but with the note about--clipboard
.