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

Container workflow creates files as 'root', even when the commands are executed by a non-root user. #2577

Closed
rahulguptajss opened this issue Jan 5, 2024 · 1 comment · Fixed by #2581
Assignees
Labels
24.02 bug Something isn't working status/done

Comments

@rahulguptajss
Copy link
Contributor

As reported by @cgrinds, the container workflow should create files owned by the user who has executed the harvest generate command.

[harvest@test harvest]$ sudo docker run --rm --entrypoint "bin/harvest" --volume "$(pwd):/opt/temp" --volume "$(pwd)/harvest.yml:/opt/harvest/harvest.yml" harvest:latest generate docker full --output harvest-compose.yml
Wrote file_sd targets to container/prometheus/harvest_targets.yml
Start containers with:
docker-compose -f prom-stack.yml -f harvest-compose.yml up -d --remove-orphans
[harvest@test harvest]$ sudo docker-compose -f prom-stack.yml -f harvest-compose.yml up -d --remove-orphans
Creating network "harvest_backend" with the default driver
Creating network "harvest_frontend" with the default driver
Creating poller-unix ... done
Creating poller-dc-1 ... done
Creating prometheus  ... done
Creating poller-u2   ... done
Creating grafana     ... done
[harvest@test harvest]$ ls -ltr
total 12
-rw-rw-r--.  1 harvest harvest 1191 Jan  4 09:59 harvest.yml
drwxr-x---.  2 root    root       6 Jan  4 10:00 cert
drwxr-x---. 10 root    root     118 Jan  4 10:00 conf
drwxr-xr-x.  3 root    root      24 Jan  4 10:00 container
drwxr-x---.  4 root    root      43 Jan  4 10:00 grafana
-rw-------.  1 root    root    1529 Jan  4 10:24 prom-stack.yml
-rw-------.  1 root    root    1110 Jan  4 10:24 harvest-compose.yml
@rahulguptajss
Copy link
Contributor Author

verified in main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
24.02 bug Something isn't working status/done
Projects
None yet
1 participant