kasmtech / workspaces-images

Other
730 stars 241 forks source link

cp: cannot access '/home/kasm-default-profile/./.cache': Permission denied #3

Open dattapw opened 3 years ago

dattapw commented 3 years ago

I run:

$ sudo docker build -t kasmweb/firefox:dev -f dockerfile-kasm-firefox-flash .        

It builds fine. BUT when I try to run it, it exits with the following error:

$ sudo docker run --rm  -it --shm-size=512m -p 6901:6901 -e VNC_PW=password kasmweb/firefox:dev

+ DEFAULT_PROFILE_HOME=/home/kasm-default-profile
+ PROFILE_SYNC_DIR=/kasm_profile_sync
+ '[' -f /home/kasm-user/.bashrc ']'
+ echo 'Profile Sync Directory Does Not Exist. No Sync will occur'
Profile Sync Directory Does Not Exist. No Sync will occur
+ copy_default_profile_to_home
+ echo 'Copying default profile to home directory'
Copying default profile to home directory
+ cp -rp /home/kasm-default-profile/. /home/kasm-user/
cp: cannot access '/home/kasm-default-profile/./.cache': Permission denied
gonzalu commented 1 year ago

Same here...

shkpk commented 1 year ago

anyone found solution of it?

jackgray commented 12 months ago

The entrypoint scripts use ~/ or $HOME to find the home directory, but since you must run these scripts as root to create some of the directories, that directory path changes from /home/kasm-user to /root, resulting in directory does not exist.

Also I think some of the startup scripts in some images use "kasm_user" and others use "kasm-user", but I still end up with the issue above after rebuilding the image with them reconciled. The process of making new users in the image build, then at startup, copying them, linking them, removing old ones, creating root level directories, is all a little too convoluted for me to wrap my head around. I have not yet been able to decipher the order in which it is all happening. I think we need to use a variable other than $HOME, like $KASM_DEFAULT_HOME and $NEW_USER_HOME so that running sudo commands or as root still uses the intended base path.

shkpk commented 12 months ago

The entrypoint scripts use ~/ or $HOME to find the home directory, but since you must run these scripts as root to create some of the directories, that directory path changes from /home/kasm-user to /root, resulting in directory does not exist.

Also I think some of the startup scripts in some images use "kasm_user" and others use "kasm-user", but I still end up with the issue above after rebuilding the image with them reconciled. The process of making new users in the image build, then at startup, copying them, linking them, removing old ones, creating root level directories, is all a little too convoluted for me to wrap my head around. I have not yet been able to decipher the order in which it is all happening. I think we need to use a variable other than $HOME, like $KASM_DEFAULT_HOME and $NEW_USER_HOME so that running sudo commands or as root still uses the intended base path.

this is because of bug in docker https://bugs.launchpad.net/ubuntu/+source/docker.io/+bug/2028392 use different version