-
Notifications
You must be signed in to change notification settings - Fork 20
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
docker command gets "permission denied" (xhost +local:root does not fix) #85
Comments
I don't really know Docker that well. I did something with it in my job, and this part: What does command |
Here's its output: So my user id is 1000 and the eponymous group id is also 1000. |
Well, don't really know what's going on. My system (fairly old):
Just to be sure I deleted everything Eldev-specific first (
Can you also try with cleaning up |
Also, similar result if I use Emacs 27 or 26 for the "outer" Eldev, not Emacs 29. I.e. this doesn't appear to depend on Emacs installed on your normal OS. |
One more thing: you may want to add |
I don't use
Workaround: Map HOST ;Eldev-local
(setq eldev-docker-executable "podman"
eldev-docker-run-extra-args '("--userns=keep-id")) Root cause: In rootless containers a user name‐space is always used, and root in the container will by default corre‐ I wonder why the explicit |
I don't know, maybe @LaurenceWarne, the author of Docker-related code, can comment? I also see now that question about UID was pointless, as 1000 is not hardcoded, but is calculated in runtime with functions |
So - the workaround indicated by @juergenhoetzel worked. In addition to this, I had to edit I found the workaround defined here https://unix.stackexchange.com/a/701785/2015 Thanks! Now I can test my package locally on multiple versions of emacs, which is pretty important. |
Like @doublep I can't reproduce with I'm glad @juergenhoetzel's workaround worked, though I admit I'm a bit confused why it works 😅. I'm not really familiar with
So what @juergenhoetzel says makes sense, since Silex's container's run as root. However, doesn't this mean no special configuration is needed? Running: podman run --rm -e 'HOME=/org-gtd.el/.eldev/docker-home' -v /home/laurencewarne/projects/org-gtd.el/:/org-gtd.el -w /org-gtd.el -v /home/laurencewarne/.cache/eldev/28.1/bootstrap/eldev-1.3.1/bin/eldev:/org-gtd.el/.eldev/docker-home/bin/eldev -v /home/laurencewarne/.cache/eldev/global-cache:/org-gtd.el/.eldev/docker-home/.eldev/global-cache silex/emacs:27.2 sh -c 'export PATH="$HOME/bin:$PATH" && eldev '\''--color=always'\'' eval 1' (this is the command While testing, I've also noticed that UI support has been dropped for the images currently being used, so I don't think |
So, while fixing issue #86, I ran into a similarly-looking problem with permissions during standard GitHub CI. Managed to solve it in commit 506b02e. Can you check if this fixes the bug that you encountered too?
Unfortunately, this is not something I can fix. Maybe you should discuss that with Silex? |
Just as a note: the reason appears to have been |
So:
With this setup, I can do If I comment out the two lines in Cleaning out So.. I'm sticking to the podman path for now, I suppose? |
Crap... Can you test if there are root-created files in |
I think as @juergenhoetzel says the explicit If so, the use of the |
What is a rootless container (sorry, I know, I suck at dockering)? Why is it that we use the same Silex-provided images, but on my machine everything works fine, yet on Trevoke's it doesn't? As I understand it, |
I'm very much a podman noob myself 😅, I believe it's just a way to run containers without root priveliges (e.g. no need to run as root or add yourself to the docker group). If you're interested I found https://developers.redhat.com/blog/2020/09/25/rootless-containers-with-podman-the-basics interesting/useful (
I think this is the case when using normal |
Ok, I think we are mixing up two issues here. Let's exclude Podman from consideration for now — maybe we simply need to add another command for it. Later. The original issue was that it fails with Docker. @Trevoke: Brief googling suggest that Docker also has a rootless mode. Do you run it in this mode? Here it runs as a root-level daemon, suggesting that it is not rootless. |
I copied the docker command and removed the
I commented out the And.. It worked. FURTHER, now when I ask it to run with It might be worth noting that the command generated is going for This might indicate that the fix you had suggested was correct, but that I didn't clean up the directory I needed to, because .. Maybe there's another bug somewhere in what eldev setup is being used? |
OK, I really suspect that it is a problem of rootless vs. "normal" container manager. I guess that's exactly what @juergenhoetzel said, but I wasn't able to comprehend it then with my poor knowledge of this stuff. Anyway, here is what I have here now:
I.e. Docker is "rootful" (according to what I find on the internet,
But with Docker it works as it always has (on this machine), and I assume this is because the current implementation is tailored to "rootful" container managers:
@Trevoke: I presume that your original post indicates that Docker on your machine is rootless (unlike here, for example). Can you confirm that? Is there a good way to find if Docker/Podman is rootless on given system? I guess we cannot have a single command that works for both cases, but maybe we can have two — and if we can find a way to choose which to use, we can resolve this issue. |
I am using ... I guess... Rooted docker?
|
Crap, I don't understand anything again. For a while, I have been thinking the problem is because of rootless Docker...
Please make sure there are no root-created files in
|
With recently released 1.4.1 you can do this simply by executing |
…an pretending to be Docker: it seems to be rootless by default; issue #85).
I committed some changes to Eldev that hopefully should improve the situation. As I now have a different (version of) OS, I was able to experiment more. As far as I understand it, the original problem was caused by installing It seems that in rootless mode we can just avoid passing option Also if you are familar with this stuff, please check the commit (it is small) and comment if something could be done better instead. |
Should be hopefully fixed in Eldev 1.10. Feel free to reopen if the fix is not enough. |
I am on Ubuntu 22, using the most recent docker desktop installation available.
If I use
docker run -it --rm silex/emacs:27.2
then this properly launches emacs in the docker container.When I try
eldev -dt docker 27.2 eval 1
I get this:If I create directories all the way down to
mkdir -p .eldev/docker-home/.eldev/27.2/bootstrap
then my next failure isI'm not really sure what is happening here, are you able to provide help?
The text was updated successfully, but these errors were encountered: