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

docker: Allow passing $DOCKER_USER to set the username in the container #2001

Merged
merged 2 commits into from
Aug 27, 2020

Conversation

nhooyr
Copy link
Contributor

@nhooyr nhooyr commented Aug 25, 2020

Needs to be reflected in the documentation and the dockerhub description
now.

Closes #881

cc @avaidyam

@avaidyam
Copy link

At first glance, this looks fantastic! It solves a definitely minor but important problem. Thanks @nhooyr!

Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entrypoint lgtm but when I run this I get:

fixuid: user 'coder' does not exist

We probably just need to update the fixuid config I imagine?

@nhooyr
Copy link
Contributor Author

nhooyr commented Aug 26, 2020

Should be good now.

@nhooyr nhooyr force-pushed the docker-user-1c5d branch 2 times, most recently from 7bac1d6 to 8317b98 Compare August 26, 2020 17:53
Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New changes look good. When I exec into the container I'm getting unable to find user coder: no matching entries in passwd file. Is it the coder line in /etc/sudoers.d/nopasswd, maybe?

@code-asher
Copy link
Member

Actually no I see that gets deleted.

@nhooyr
Copy link
Contributor Author

nhooyr commented Aug 27, 2020

Weird. 🤔

@nhooyr
Copy link
Contributor Author

nhooyr commented Aug 27, 2020

Can confirm the exec issue, debugging.

@nhooyr
Copy link
Contributor Author

nhooyr commented Aug 27, 2020

Ah, you need to set pass -u $UID so unrelated to this PR @code-asher

Needs to be reflected in the documentation and the dockerhub description now.

Closes #881
This way, building a standalone release locally and putting it in the
release contianer for testing is less likely to break.
@code-asher
Copy link
Member

Ahhhhh yup that worked! Now I'm getting

OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "chdir to cwd (\"/home/coder\") set in config.json failed: no such file or directory": unknown

Is that happening to you?

@nhooyr
Copy link
Contributor Author

nhooyr commented Aug 27, 2020

Huh, no, my shell opened fine.

@nhooyr
Copy link
Contributor Author

nhooyr commented Aug 27, 2020

i.e docker exec -u $UID -it 5c3a18e17438 bash -li works perfectly for me.

@nhooyr
Copy link
Contributor Author

nhooyr commented Aug 27, 2020

We discussed on slack and the error is unrelated to this PR.

@nhooyr nhooyr merged commit d8d5908 into master Aug 27, 2020
@nhooyr nhooyr deleted the docker-user-1c5d branch August 27, 2020 19:51
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.

4 participants