nickjj / nickjj/docker-flask-example

cannot create directory ‘public/js’: Permission denied - Rootless docker

Open
#19 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
765
Forks
139
PR merge metrics
No merged PRs in 30d

Description

Hey Nick, first of all, thank you so much for this amazing repo, man, it is helping me a lot.

I just want to check with you if it is possible to run this repo in an env where docker is installed as rootless.

When I run docker compose up in my nixos, with "root-full" docker, everything works fine, but doesn`t work if I run in a rootless docker.

Will share here some outputs.

[beto@nixos:~/test/ruby_projects/docker-flask-example]$ docker compose run web mkdir public/js
[+] Building 0.0s (0/0)                                                                                                                                                                      docker:default
[+] Creating 2/0
 ✔ Container helloflask-redis-1     Created                                                                                                                                                            0.0s 
 ✔ Container helloflask-postgres-1  Created                                                                                                                                                            0.0s 
[+] Running 2/2
 ✔ Container helloflask-redis-1     Started                                                                                                                                                            0.3s 
 ✔ Container helloflask-postgres-1  Started                                                                                                                                                            0.3s 
[+] Building 0.0s (0/0)                                                                                                                                                                      docker:default
mkdir: cannot create directory ‘public/js’: Permission denied


[beto@nixos:~/test/ruby_projects/docker-flask-example]$ docker compose run web id
[+] Building 0.0s (0/0)                                                                                                                                                                      docker:default
[+] Creating 2/0
 ✔ Container helloflask-redis-1     Running                                                                                                                                                            0.0s 
 ✔ Container helloflask-postgres-1  Running                                                                                                                                                            0.0s 
[+] Building 0.0s (0/0)                                                                                                                                                                      docker:default
uid=1000(python) gid=1000(python) groups=1000(python)


[beto@nixos:~/test/ruby_projects/docker-flask-example]$ docker compose run js id
[+] Building 0.0s (0/0)                                                                                                                                                                      docker:default
[+] Building 0.0s (0/0)                                                                                                                                                                      docker:default
uid=1000(node) gid=1000(node) groups=1000(node)


[beto@nixos:~/test/ruby_projects/docker-flask-example]$ id
uid=1000(beto) gid=100(users) groups=100(users),1(wheel),57(networkmanager),1000(beto)


[beto@nixos:~/test/ruby_projects/docker-flask-example]$ docker compose run css id
[+] Building 0.0s (0/0)                                                                                                                                                                      docker:default
[+] Building 0.0s (0/0)                                                                                                                                                                      docker:default
uid=1000(node) gid=1000(node) groups=1000(node)


[beto@nixos:~/test/ruby_projects/docker-flask-example]$ ls -ln
total 104
-rw-r--r-- 1 1000 1000  1936 jan 17 15:18 alembic.ini
drwxr-xr-x 5 1000 1000  4096 jan 17 15:18 assets
drwxr-xr-x 2 1000 1000  4096 jan 17 15:18 bin
-rw-r--r-- 1 1000 1000 13853 jan 17 15:18 CHANGELOG.md
drwxr-xr-x 2 1000 1000  4096 jan 17 15:18 config
drwxr-xr-x 3 1000 1000  4096 jan 17 15:18 db
-rw-r--r-- 1 1000 1000  3278 jan 17 20:35 docker-compose.yml
-rw-r--r-- 1 1000 1000  2145 jan 17 15:18 Dockerfile
drwxr-xr-x 5 1000 1000  4096 jan 17 15:18 hello
drwxr-xr-x 2 1000 1000  4096 jan 17 15:18 lib
-rw-r--r-- 1 1000 1000  1108 jan 17 15:18 LICENSE
drwxr-xr-x 2 1000 1000  4096 jan 17 15:18 public
-rw-r--r-- 1 1000 1000   104 jan 17 15:18 pyproject.toml
-rw-r--r-- 1 1000 1000 18044 jan 17 15:18 README.md
-rw-r--r-- 1 1000 1000   850 jan 17 15:18 requirements-lock.txt
-rw-r--r-- 1 1000 1000   357 jan 17 15:18 requirements.txt
-rwxr-xr-x 1 1000 1000  4243 jan 17 15:18 run
drwxr-xr-x 3 1000 1000  4096 jan 17 15:18 test

I ask for your help, please.

Thanks in advance.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting docker-compose.yml and Dockerfile, then reproduce the reported rootless command docker compose run web mkdir public/js. Done means the web service can create public/js under rootless Docker without the reported permission error, while the existing service setup continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, nixos
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.