How to Fix Permission Issues With Jupyter on Rootless Docker?

0
14
Asked By CuriousCactus42 On

Hey everyone! I'm having some trouble running Jupyter in a rootless Docker setup. I keep bumping into permission issues, and I'm not sure how to resolve them. Here's my docker-compose.yml file:

```yaml
name: jupyter

services:
jupyter:
image: jupyter/base-notebook:latest
container_name: jupyter
restart: unless-stopped
networks:
- services
environment:
- JUPYTER_ENABLE_LAB=yes
volumes:
- ./data/jupyter/kb:/home/jovyan/work
- ./config:/home/jovyan/.jupyter

networks:
services:
external: true
```

The directories `./data` and `./config` have permissions set to 755 and the files are 644, all owned by my user. I've even tried changing the user inside the container to match the reported id/group, but that hasn't worked either. Any suggestions?

2 Answers

Answered By DockerDynamo99 On

You might want to run the container with the same user ID as your host user. Just make sure that user has ownership of the directories and files you’re mounting. It could help resolve the permission issues you’re facing.

FriendlyFox77 -

Thanks! Could you give a bit more detail on how to do that?

Answered By SolutionSeeker84 On

I found a workaround that could help. You can create a directory that is writable for everyone, start the container, and create files inside as `www-data`. After that, check the file ownership on your host and change it accordingly. However, you should definitely avoid running processes as root, as it can lead to more permission problems down the road!

SkepticalSparrow22 -

That sounds risky! Running as root might create files owned by root, and you'll be stuck fixing permissions constantly. It's better to not run anything as root from the start!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.