Skip to content
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

Running in rootless docker is nonfunctional with host filesystem bind mounts due to overriden user ID inside container #716

Open
tazz4843 opened this issue Nov 1, 2023 · 0 comments

Comments

@tazz4843
Copy link

tazz4843 commented Nov 1, 2023

I'm using a docker-compose.yml file to orchestrate setup. Data has not been showing up in Influx since I started trying to set it up. After several hours of digging, I noticed the bind mounts I had set up in the docker-compose.yml file had an unusual user ID attached:

as sudo niko@niko-desktop docker-compose-influxdb-grafana > ls -lh data/
total 8.0K
drwxr-xr-x 1 niko   niko 62 Nov  1 15:34 grafana/
drwx------ 1 100999 niko 40 Nov  1 15:37 influx/
drwxrwxr-x 1 100999 niko 28 Nov  1 14:41 influx-config/

This persists despite user ID 0 being forced in the docker-compose.yml file, which maps to my true user on the host system in a rootless setup:

version: '2'
services:
  influxdb:
    image: influxdb:latest
    ports:
      - '8086:8086'
    user: "0:0"
    volumes:
      - ./data/influx:/var/lib/influxdb2
      - ./data/influx-config:/etc/influxdb2
    environment:
      - DOCKER_INFLUXDB_INIT_MODE=setup
      - DOCKER_INFLUXDB_INIT_USERNAME=redacted
      - DOCKER_INFLUXDB_INIT_PASSWORD=redacted
      - DOCKER_INFLUXDB_INIT_ORG=weather
      - DOCKER_INFLUXDB_INIT_BUCKET=main
  grafana:
    image: grafana/grafana:latest
    ports:
      - '3000:3000'
    user: "0:0"
    volumes:
      - ./data/grafana:/var/lib/grafana
      - ./grafana-provisioning/:/etc/grafana/provisioning
    depends_on:
      - influxdb
    environment:
      - GF_SECURITY_ADMIN_USER=${GRAFANA_USERNAME}
      - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}

Grafana complains once at startup that it's running as a privileged user, when in actuality it is running as my user. However, InfluxDB fails silently with no permissions errors or anything of the sort mentioned in logs. The only reason I eventually figured this out was because of a GitHub issue: itzg/docker-minecraft-server#1934 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant