-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opening confirmation window for docker pull fails #109
Comments
Thanks for reporting! I've stumbled over this, too. It also happens on some other circumstances. So I regularly have a hassle with this. Yesterday I decided to drop the question I am not entirely sure if this is a good decision. Edit: I also consider to drop opening a terminal window to ask for sudo/root password if it is required to run docker. Instead x11docker would show an error and ask to run it as root. |
Frankly, I did never like popups for this kind of interaction. If I run a script in a shell, I expect all interactions with it to be bound to the window. I did not bring this previously because it was a design decission of yours. However, since you brought it... I agree on failing if user interaction is required outside of the window where x11docker is executed.
Although you cannot assume it, can you tell when is x11docker started in a terminal? Is there any other context, apart from x11docker-gui and Applications Menu shortcuts, where x11docker is not started in a shell? I am thinking about adding some envvar or CLI option to explicitly tell when x11docker is started from a GUI.
I prefer not to execute actions that could potentially have a relevant impact in the host, without explicit permission from the user. Although pulling a docker image can seem harmless, there are some contexts where it should be avoided. E.g., if the image name was not spelled correctly but the wrongly written image exists, x11docker will pull an image that is not required. Time and bandwidth will be used, and it will fail later. Another example: an image which is larger than the available space on disk is pulled. I would suggest adding option
If you cannot tell when x11docker is started from a GUI, the timeout can be always applied. I.e., the user is given 30s, 1min, 5min to reply to the questions. Otherwise, it will fail.
I think it is important to be consistent. If BTW, what do you need sudo for? Is it just to execute docker in GNU/Linux if the user is not in group
The difference between the two later options is that |
Thanks for your feedback!
It seems that a check with
I agree.
The only question is to pull or not. I've included an interactive question in terminal if x11docker runs in a terminal. It timeouts after 60 seconds and terminates with an error instead of pulling the image.
Yes. Although it is widely used, membership in group
I consider to add an option |
You are welcome!
Great! Let me know when I can test it.
That's great.
Thanks for the remainder. Is there any note suggesting this when the user is a member of group
Great too! Does it make sense to prompt for password only if
Great idea! |
The update is already in master. Before updating you can just check
Currently not. But I might include it as x11docker targets to be a sandbox solution.
I don't think so. Users not being member of group docker should not be forced to always type |
# tty -s && echo ok
ok
Agree.
I forgot that x11docker can start non-docker apps too. |
I pulled the master branch, I removed # ./x11docker -i -t --user=RETAIN --cap-default -- -p=8080:8085 -e BROADWAY_DISPLAY=:5 -e GDK_BACKEND=broadway -- x11docker/xfce "broadwayd :5 & sleep 2 && xfce4-terminal"
x11docker WARNING: Command 'xauth' not found.
Please install 'xauth' to allow X cookie authentication.
Fallback: Disabling X authentication protocol. (option --no-auth)
x11docker note: Per default x11docker stores its cache files on drive C:.
docker setup may not allow to share files from drive C:.
If startup fails with an 'access denied' error,
please either allow access to drive C: or specify a custom folder for cache
storage with option '--cachebasedir D:/some/cache/folder'.
Same issue can occur with option '--home'.
Use option '--homebasedir D:/some/home/folder' in that case.
x11docker note: Windows firewall settings can forbid application access
to the X server. If no application window appears, but no obvious error
is shown, please check your firewall settings. Compare issue #108 on github.
x11docker WARNING: Option --cap-default disables security hardening
for containers. Granting docker's default capabilities is considered insecure.
x11docker WARNING: Option --no-auth: SECURITY RISK!
Allowing access to X server for everyone.
x11docker note: Did not find container init system 'tini'.
This is a bug in your distributions docker package.
Normally, docker provides init system tini as '/usr/bin/docker-init'.
x11docker uses tini for clean process handling and fast container shutdown.
To provide tini yourself, please download tini-static:
https://github.com/krallin/tini/releases/download/v0.18.0/tini-static
Store it in one of:
/home/eine/.local/share/x11docker/
/usr/local/share/x11docker/
Image 'x11docker/xfce' 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
Using default tag: latest
latest: Pulling from x11docker/xfce
Digest: sha256:a0e5226c367c2f92e76822bdf237adcc1c1ba8a30a89b67801e28f007b78be11
Status: Downloaded newer image for x11docker/xfce:latest
mkdir: missing operand
Try 'mkdir --help' for more information.
Unable to init server: Could not connect: Connection refused
(xfce4-terminal:83): Gtk-WARNING **: 03:43:51.372: cannot open display:
Listening on /tmp/XDG_RUNTIME_DIR/broadway6.socket
x11docker note: User in container: uid=0(root) gid=0(root) groups=0(root)
root:x:0:0:root:/root:/bin/bash
Failed to connect to session manager: Failed to connect to the session manager: SESSION_MANAGER environment variable not defined It works as expected, but note |
Thanks, is fixed now. The fix caused some changes in I have another design question: |
I tested it. It works as expected.
I agree with both points: it will be an unpopular default and it fits the sandbox target. In order to work around the popularity issue, and related to this comment about
Overall, I think that there is very interesting know-how in this project, and it might be more popular if the entry barrier could be slightly reduced for active docker users. |
I removed # ./x11docker -i -t --user=0 -- -p=8080:8085 -e BROADWAY_DISPLAY=:5 -e GDK_BACKEND=broadway -- x11docker/xfce "broadwayd :5 & sleep 2 && xfce4-terminal"
...
Image 'x11docker/xfce' 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/x11docker-xfce-34ddc4/dockerrc: line 123: notify-send: command not found
Using default tag: latest
x11docker note: Pulling image x11docker/xfce from docker hub
... Everything works ok. It's just that message about |
Yes, let's close this ticket. We can open a new one called "Enhancement and design discussion". #113 |
While trying to use an image (which is not available locally) in interactive mode, opening a new window to ask for confirmation to
docker pull
fails. However, the image is downloaded and both the X server and the container are successfully created.The text was updated successfully, but these errors were encountered: