Fix file permission issue in toxchat/bootstrap-node

/var/lib/tox-bootstrapd on the host is owned by hosts's tox-bootstrapd
and chowned 700, but the container attempts to access it as its own
tox-bootstrapd user with possibly different uid:gid, which will fail if
host's tox-bootstrapd user has different uid:gid than the tox-bootstrapd
user inside the container.

This change makes the container use host's tox-bootstrapd uid:gid, which
fixes the issue.
This commit is contained in:
Maxim Biro 2021-12-14 07:01:47 -05:00
parent 0538273479
commit 805858716e
No known key found for this signature in database
GPG Key ID: AB3AD9896472BFA4
2 changed files with 4 additions and 0 deletions

View File

@ -14,6 +14,7 @@ sudo useradd \
--user-group tox-bootstrapd
sudo chmod 700 /var/lib/tox-bootstrapd
docker run -d --name tox-bootstrapd \
--user "$(id -u tox-bootstrapd):$(id -g tox-bootstrapd)" \
-v /var/lib/tox-bootstrapd/:/var/lib/tox-bootstrapd/ \
--ulimit nofile=32768:32768 \
-p 443:443 \

View File

@ -249,6 +249,7 @@ sudo useradd \
sudo chmod 700 /var/lib/tox-bootstrapd
docker run -d --name tox-bootstrapd --restart always \
--user "$(id -u tox-bootstrapd):$(id -g tox-bootstrapd)" \
-v /var/lib/tox-bootstrapd/:/var/lib/tox-bootstrapd/ \
--ulimit nofile=32768:32768 \
-p 443:443 \
@ -284,7 +285,9 @@ Then rebuild and run the image again:
```sh
tar c $(git ls-files) | docker build -f other/bootstrap_daemon/docker/Dockerfile -t toxchat/bootstrap-node -
docker run -d --name tox-bootstrapd --restart always \
--user "$(id -u tox-bootstrapd):$(id -g tox-bootstrapd)" \
-v /var/lib/tox-bootstrapd/:/var/lib/tox-bootstrapd/ \
--ulimit nofile=32768:32768 \
-p 443:443 \
-p 3389:3389 \
-p 33445:33445 \