Silex / docker-emacs

Run Emacs in docker containers!
https://hub.docker.com/r/silex/emacs
GNU General Public License v3.0
208 stars 42 forks source link

Can't use Cask from a non-root user account #68

Closed ryuslash closed 3 years ago

ryuslash commented 4 years ago

Hey!

I've been trying to run some builds and tests for my Emacs projects on Jenkins, but I'm unable to use Cask because Jenkins will run any commands as a non-root user. That results in the following error:

cask: Permission denied

This can be easily reproduced by running this command:

docker run --rm -u 1000:1000 silex/emacs:27.1-alpine-dev /bin/sh -c cask

I will admit that I'm not quite sure yet how to tell Jenkins to run commands in docker as root yet, but it seems like it would be a better idea to be able to run Cask as any user regardless.

Silex commented 4 years ago

Good idea! Maybe @conao3 can help?

This is how we install Cask: https://github.com/Silex/docker-emacs/blob/master/templates/ubuntu/18.04/dev/Dockerfile#L65-L66

What should we do so it runs for all users?

ryuslash commented 4 years ago

I was looking at what the arch user repository script does, it seems to manually install all the files in place.

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=cask

I was also looking at the go script in the cask repository, but that doesn't seem to offer any way to install it anywhere other than the user's home directory. Maybe I need to have a closer look, though...

conao3 commented 4 years ago

Thanks for reporting issue. I have no time now, I'll investigate it after.

ryuslash commented 4 years ago

I had another look and the go script is just calling git clone and then cask upgrade-cask. I'm trying out a build with just those commands now to see if it works.

ryuslash commented 4 years ago

I still get a permission denied error, but this time I think this is because the user 1000 in the container doesn't have a home directory. I'm not quite sure if that is necessary when we're installing dependencies for a build.

Silex commented 3 years ago

@ryuslash: do you still suffer from this?

ryuslash commented 3 years ago

Yes and no, I haven't been able to really fix this, because even if Cask can be run without admin privileges, I don't know as which user Jenkins will run the command inside the container, which means I don't know where to create the home directory, and Cask fails if the home directory doesn't exist.

I also haven't been using Jenkins lately for my own projects since it was taking up too much space, so it hasn't been an issue for me.

Silex commented 3 years ago

Well I'll consider it a Cask problem :-)

Reopen if needed.