docker rootless homedir not writeable #9143

Closed
opened 2025-11-02 08:30:40 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @FredFoo on GitHub (Jun 28, 2022).

Description

When I try to run docker rootless I get this:

user@machine-a1$ docker run --rm --name gitea-t1 --hostname gitea-t1 -v git-data:/var/lib/gitea -v git-etc:/etc/gitea gitea/gitea:latest-rootless
/var/lib/gitea/git is not writable
docker setup failed

If I do it manually, I can do this:

user@machine-a1$ docker run -it --rm --name gitea-t1 --hostname gitea-t1 --entrypoint /bin/bash -v git-data:/var/lib/gitea -v git-etc:/etc/gitea gitea/gitea:latest-rootless
bash-5.1$ ls -l /var/lib/gitea
total 0
drwx------    1 git      git             34 Jun 28 08:31 git
bash-5.1$ echo $HOME
/var/lib/gitea/git
bash-5.1$ if [ ! -w ${HOME} ]; then echo "${HOME} is not writable";fi
/var/lib/gitea/git is not writable
bash-5.1$ touch $HOME/test
bash-5.1$ ls -l $HOME
total 0
-rw-r--r--    1 git      git              0 Jun 28 08:31 test

Seems to me that ! -w $HOME always returns true and the setup script exits in line 5. If I manually create a file it seems to me quite writeable indeed.

And why is gitea:latest-rootless an rc1? Should latest not be the latest stable release?

Gitea Version

Gitea version 1.17.0+rc1 built with GNU Make 4.3, go1.18.3 : bindata, timetzdata, sqlite, sqlite_unlock_notify

Originally created by @FredFoo on GitHub (Jun 28, 2022). ### Description When I try to run docker rootless I get this: ``` user@machine-a1$ docker run --rm --name gitea-t1 --hostname gitea-t1 -v git-data:/var/lib/gitea -v git-etc:/etc/gitea gitea/gitea:latest-rootless /var/lib/gitea/git is not writable docker setup failed ``` If I do it manually, I can do this: ``` user@machine-a1$ docker run -it --rm --name gitea-t1 --hostname gitea-t1 --entrypoint /bin/bash -v git-data:/var/lib/gitea -v git-etc:/etc/gitea gitea/gitea:latest-rootless bash-5.1$ ls -l /var/lib/gitea total 0 drwx------ 1 git git 34 Jun 28 08:31 git bash-5.1$ echo $HOME /var/lib/gitea/git bash-5.1$ if [ ! -w ${HOME} ]; then echo "${HOME} is not writable";fi /var/lib/gitea/git is not writable bash-5.1$ touch $HOME/test bash-5.1$ ls -l $HOME total 0 -rw-r--r-- 1 git git 0 Jun 28 08:31 test ``` Seems to me that ! -w $HOME always returns true and the setup script exits in line 5. If I manually create a file it seems to me quite writeable indeed. And why is gitea:latest-rootless an rc1? Should latest not be the latest stable release? ### Gitea Version Gitea version 1.17.0+rc1 built with GNU Make 4.3, go1.18.3 : bindata, timetzdata, sqlite, sqlite_unlock_notify
GiteaMirror added the issue/needs-feedback label 2025-11-02 08:30:40 -06:00
Author
Owner

@FredFoo commented on GitHub (Jun 28, 2022):

Just tried gitea:1.16-rootless and it works fine!

bash-5.1$ if [ ! -w ${HOME} ]; then echo "${HOME} is not writable";fi
bash-5.1$
@FredFoo commented on GitHub (Jun 28, 2022): Just tried gitea:1.16-rootless and it works fine! ``` bash-5.1$ if [ ! -w ${HOME} ]; then echo "${HOME} is not writable";fi bash-5.1$ ```
Author
Owner

@wxiaoguang commented on GitHub (Jun 28, 2022):

Just a guess, check your docker version, make sure it >= 20.10.6

@wxiaoguang commented on GitHub (Jun 28, 2022): Just a guess, check your docker version, make sure it >= 20.10.6
Author
Owner

@FredFoo commented on GitHub (Jun 28, 2022):

Docker on prod is indeed 19.10, which I cannot touch. Tested with 20.10.17 and it works. Good guess :)

I will stick with 1.16 anyways and revisit when 1.17 is released.

@FredFoo commented on GitHub (Jun 28, 2022): Docker on prod is indeed 19.10, which I cannot touch. Tested with 20.10.17 and it works. Good guess :) I will stick with 1.16 anyways and revisit when 1.17 is released.
Author
Owner

@wxiaoguang commented on GitHub (Jun 28, 2022):

That's related to a docker's bug https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.14.0#faccessat2

It's time for your production to upgrade 😁

@wxiaoguang commented on GitHub (Jun 28, 2022): That's related to a docker's bug https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.14.0#faccessat2 It's time for your production to upgrade 😁
Author
Owner

@alorence commented on GitHub (Aug 25, 2022):

I fight against this particular issue for hours now, while my Docker version is already up-to-date (20.10.17).
Updating the CentOS system with yum update shown the following issue:

Warning: RPMDB altered outside of yum.
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
3:docker-ce-20.10.17-3.el7.x86_64 has missing requires of containerd.io >= ('0', '1.4.1', None)

The command updated package containerd.io from 1.3.9 to 1.6.7, which solved the issue.

Thanks for the tip !

@alorence commented on GitHub (Aug 25, 2022): I fight against this particular issue for hours now, while my Docker version is already up-to-date (20.10.17). Updating the CentOS system with `yum update` shown the following issue: ``` Warning: RPMDB altered outside of yum. ** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows: 3:docker-ce-20.10.17-3.el7.x86_64 has missing requires of containerd.io >= ('0', '1.4.1', None) ``` The command updated package `containerd.io` from 1.3.9 to 1.6.7, which solved the issue. Thanks for the tip !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9143