0

I am running docker "rootless" according to this guide: https://docs.docker.com/engine/security/rootless/

The user which actually runs docker is svc_test.

When I try and start a docker container which has diretory mounts which don't exists - the docker daemon (a.k.a. svc_test user) attempts to mkdir these directories, but fails with

docker: Error response from daemon: error while creating mount source path '/dir_path/dir_name': mkdir /dir_path/dir_name: permission denied.

When I (svc_test) them attempt to do mkdir /dir_path/dir_name I succeed without any issues.

What is going on here and why does this happen? Clearly I am missing something, but I can't trace what is that exactly.

Update 1: This is the specific docker cmd I use to run the container:

docker run -d --restart unless-stopped \
    --name questdb \
    -e QDB_METRICS_ENABLED=TRUE \
    --network="host" \
    -v /my_mounted_volume/questdb:/questdb \
    -v /my_mounted_volume/questdb/public:/questdb/public \
    -v /my_mounted_volume/questdb/conf:/questdb/conf \
    -v /my_mounted_volume/questdb/db:/questdb/db \
    -v /my_mounted_volume/questdb/log:/questdb/log \
    questdb/questdb:6.5.2 /usr/bin/env QDB_PACKAGE=docker  /app/bin/java \
    -m io.questdb/io.questdb.ServerMain \
    -d /questdb \
    -f

For clarity: my final goal is to be able to run the docker container in question from the same user form which I run my docker daemon (the svc_test user). Hence how I stumbled on this problem.

Newskooler
  • 3,973
  • 7
  • 46
  • 84
  • Surely it's easy to make a MVCE and post that docker file here? – weston Feb 05 '23 at 01:20
  • What is the *specific* `docker run` command you're using? The specific paths matter. – larsks Feb 05 '23 at 01:31
  • @larsks i shared this with an update now. Weston I don't know what MVCE is, but I hope the updated question can help. – Newskooler Feb 05 '23 at 01:47
  • could be wrong but don't the mounted volumes still have the same user:group and flags set on them in the container? Maybe `ls -la` the files once inside the container. You might need to set the user on the run command to align with the volumes. – nullsteph Feb 05 '23 at 02:17

0 Answers0