I am running Influxdb image with mounted volume like this:
docker run -v $(pwd)/data:/var/lib/influxdb influxdb
This will create data/
directory owned by root:
$ ls -ld data/
drwxr-xr-x 5 root root 4096 Jun 10 10:47 data/
I can not find out how to mount volume under common user. It is not possible to move the directory unless logged in as root. I know I can chown the directory and I've found Docker container creating directories owned by root, I need them owned by 1000:1000, but I would like to know if Influxdb image can handle it on its own?
If I run it as current user:
docker run --user=$UID -v $(pwd)/data/:/var/lib/influxdb influxdb
I end up with:
run: create server: mkdir all: mkdir /var/lib/influxdb/meta: permission denied