-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Broken permissions on rootless docker install #29568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have an similar issue with 1.21.7 . At first I thought I broke my setup, but after hours of trying I used 1.21.6 and everything worked again. |
Same here: Running services:
gitea:
image: gitea/gitea:1.21.6-rootless
container_name: gitea
restart: always
user: "1001:1001"
network_mode: services
volumes:
- ./data:/var/lib/gitea
- ./config:/etc/gitea
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3002:3000"
- "2222:22" Error logs:
Dir Permissions output
I'm currently on ARM64:
|
I'm having the same issue, using NFS, rootless. Have 10 other containers working fine with this setup and using the same NFS server. |
I guess it took sometime for dudes to learn that an non-root process should not be modifying anything beyond their own home directory, including system stuff under Currently, given how the offending script was written, you maybe able to get around the checking code by providing your own Simply put, you first generate a version: "3"
networks:
gitea:
external: false
services:
server:
image: gitea/gitea:1.21.7-rootless
container_name: gitea
environment:
- SSH_USER=git
- USER_UID=2001
- USER_GID=2001
+ - GITEA_APP_INI=/etc/gitea/conf/app.ini
restart: unless-stopped
networks:
- gitea
volumes:
- ./volume/data:/data
- - ./volume/etc:/etc/gitea
+ - ./volume/etc:/etc/gitea:ro
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "80:3000"
- "2222:22" This might escape the check, allowing the container to spin up successfully. HOWEVER, all of this was, as I said, a escape, not a root fix. The correct fix should be not writing to Hope it helped :) |
I have the exact same problem however the suggestion by @nirui did not work for me. I am also using named volumes for storing the data. Edit: I'm using podman so I intend to run rootless. Running rootless presents the exact issue above. I think the Docker implementation needs a total rewrite for running securely, if at all. |
Not sure what went wrong in your case @dresch86. The key is to get around the I do agreed that the rootless Docker images for Gitea is really messed up, and desire some major rework. In addition to that, I really don't understand why Gitea allows both the user and the program itself to modify it's config file ( A good rule of thumb is that static setting (db, directory etc) should be user modifiable only, and dynamic setting (site title, themes etc) should be modified through the software. |
Description
I am having trouble getting the rootless docker install to work. I have a specific user that i need to run gitea as. However it is seemingly not possible.
My environment:
Ubuntu 22.04 lxc guest running on Proxmox with NFS storage.
UID mappings for storage are working as expected.
Username: git
Host UID & GID: 102001
Guest UID & GID: 2001
Everything below is from the guest pov.
/nfs/data0/docker
is mounted and owned bygit (2001:2001)
Setup
Ive tried numerous ways to get this working. They all result in either the data & config not persisting to disk, or failed attempts to mkdir or chown paths. I have tried creating the paths manually before starting. in some cases it gets a little further but still lands on another permission error.
That said, within the docker container, the git user (2001) "can" create,modify, and remove any thing on its mount point(s). root (0) cannot do this. Is there a way to force this to do everything as git?
Gitea Version
1.21.7-rootless
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
N/A
Operating System
Ubuntu 22.02 LXC guest on Proxmox 8.0.3/Debian 12 host
How are you running Gitea?
Docker compose: image: gitea/gitea:1.21.7-rootless
Details in main post
Database
None
The text was updated successfully, but these errors were encountered: