Skip to content
Snippets Groups Projects
Commit cca5c031 authored by Simon Li's avatar Simon Li
Browse files

Fix permissions on ~/.cache

`apt-get install xorg` somehow results in a `/home/jovyan/.cache` directory being created and owned by `root`, maybe because `HOME` is set to `/home/jovyan`? This prevents the `jovyan` user running other programs such as Firefox:

```
$ podman build -t jupyter-desktop-server .
...

$ podman run --rm jupyter-desktop-server ls -la
total 40
drwxrwxr-x. 7 jovyan users 4096 Aug 16 17:04 .
drwxr-xr-x. 3 root   root  4096 Aug 16 17:04 ..
-rw-rw-r--. 1 jovyan users  220 Feb 25 12:03 .bash_logout
-rw-rw-r--. 1 jovyan users 3770 Jun 18 03:05 .bashrc
drwx------. 2 root   root  4096 Aug 16 17:02 .cache
drwxrwxr-x. 2 jovyan users 4096 Aug 16 17:04 .conda
drwsrws---. 3 jovyan users 4096 Jun 18 03:10 .config
drwsrws---. 2 jovyan users 4096 Jun 18 03:10 .jupyter
-rw-rw-r--. 1 jovyan users  807 Feb 25 12:03 .profile
drwsrwsr-x. 2 jovyan users 4096 Jun 18 03:05 work

```

Note `fix-permissions $HOME` only makes it group writeable, it doesn't fix the owner which is why I'm using `chown` instead.
```
drwxrwxr-x. 7 jovyan users 4096 Aug 16 17:08 .
drwxr-xr-x. 3 root   root  4096 Aug 16 17:08 ..
-rw-rw-r--. 1 jovyan users  220 Feb 25 12:03 .bash_logout
-rw-rw-r--. 1 jovyan users 3770 Jun 18 03:05 .bashrc
drwxrwx---. 3 root   users 4096 Aug 16 17:08 .cache
drwxrwxr-x. 2 jovyan users 4096 Aug 16 17:08 .conda
drwsrws---. 3 jovyan users 4096 Jun 18 03:10 .config
drwsrws---. 2 jovyan users 4096 Jun 18 03:10 .jupyter
-rw-rw-r--. 1 jovyan users  807 Feb 25 12:03 .profile
drwsrwsr-x. 2 jovyan users 4096 Jun 18 03:05 work
```
parent d646f371
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,8 @@ RUN apt-get -y update \ ...@@ -12,6 +12,8 @@ RUN apt-get -y update \
xfce4-settings \ xfce4-settings \
xorg \ xorg \
xubuntu-icon-theme xubuntu-icon-theme
# apt-get may result in root-owned directories/files under $HOME
RUN chown -R $NB_UID:$NB_GID $HOME
USER $NB_USER USER $NB_USER
ADD . /opt/install ADD . /opt/install
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment