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

dockerfile: Improve UID/GID handling (fixes #5180) #5181

Merged
merged 1 commit into from
Sep 11, 2018

Conversation

calmh
Copy link
Member

@calmh calmh commented Sep 11, 2018

Purpose

This removes the user and group juggling, which would fail when given
for example a PGID that already existed as the "syncthing" group could
then not be created with that PGID. It's not reasonable to expect the
user to know which group/user names/IDs are already present in the
Docker image.

Instead we now just launch under the specified IDs, while manually
setting the HOME env var to give us a home directory - the only thing we
needed the user entry for anyway.

Also updates to Go 1.11 and building without upgrades instead of
disabling by env var.

Testing

I've ran it manually under existing and non-existing IDs, and it works for me; previously it didn't.

$ docker run -it --rm -e PUID=2 -e PGID=2 syncthing
$ docker run -it --rm -e PUID=12345 -e PGID=12345 syncthing

This removes the user and group juggling, which would fail when given
for example a PGID that already existed as the "syncthing" group could
then not be created with that PGID. It's not reasonable to expect the
user to know which group/user names/IDs are already present in the
Docker image.

Instead we now just launch under the specified IDs, while manually
setting the HOME env var to give us a home directory - the only thing we
needed the user entry for anyway.

Also updates to Go 1.11 and building without upgrades instead of
disabling by env var.
@AudriusButkevicius AudriusButkevicius merged commit 60a6a40 into syncthing:master Sep 11, 2018
@calmh calmh added this to the v0.14.51 milestone Sep 11, 2018
@calmh calmh deleted the fix-5180 branch November 1, 2018 05:56
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Sep 12, 2019
@syncthing syncthing locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants