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

fix(cli): Handle chown failures when running as non-root #63

Merged
merged 1 commit into from
Jan 17, 2019

Conversation

orangejulius
Copy link
Member

@orangejulius orangejulius commented Jan 16, 2019

In #55 we added a chown line that attempts to set proper permissions on the Elasticsearch data directory.

chown can generally only be run as root, so this PR adds handling for the common case where chown fails.

In general, either the pelias CLI is run as root, and the chown will succeed, or the CLI is run as the same user the Docker container processes will run as. In this case the mkdir on the preceding line will set up the directory with proper ownership.

We can't really do anything in an automated way to handle people running the Pelias CLI as a different, non-root, user than the one they want the containers to run with, so I think this is the best we can do.

This will be even more useful once #62 is merged.

In #55 we added a `chown` line that
attempts to set proper permissions on the Elasticsearch data directory.

`chown` can generally only be run as root, so this PR adds handling for
the common case where `chown` fails.

In general, either the pelias CLI is run as root, and the `chown` will
succeed, or the CLI is run as the same user the Docker container
processes will run as. In this case the `mkdir` on the preceding line
will set up the directory with proper ownership.

We can't really do anything in an automated way to handle people running
the Pelias CLI as a different, non-root, user than the one they want the
containers to run with, so I think this is the best we can do.

This will be even more useful once #62 is merged.
@orangejulius orangejulius merged commit 292ff77 into master Jan 17, 2019
@orangejulius orangejulius deleted the better-chown-handling branch January 17, 2019 21:11
calpb pushed a commit to sorelle/docker that referenced this pull request Mar 29, 2021
fix(cli): Handle chown failures when running as non-root
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

Successfully merging this pull request may close these issues.

1 participant