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

adduser #28

Closed
adaniline-traderev opened this issue May 15, 2019 · 4 comments
Closed

adduser #28

adaniline-traderev opened this issue May 15, 2019 · 4 comments

Comments

@adaniline-traderev
Copy link

adduser is not part of the image...
If I don't want to run my app as root, what is the way to add an app user to my image?

@iliana
Copy link
Contributor

iliana commented May 15, 2019

Would something like this work?

FROM amazonlinux:2
RUN yum install -y shadow-utils && yum clean all && useradd user
USER user

@yosifkit
Copy link

For docker, the user id doesn't have to exist to use it 😉:

FROM amazonlinux:2
USER 1000

@adaniline-traderev
Copy link
Author

Thank you, good to know!
I did not realize it is possible - I always was adding users to the image..

@Veetaha
Copy link

Veetaha commented Aug 11, 2023

For those desperate souls that can't find useradd in this image. Here is my blessing. It is there, you already have it in possession. No need to thank, I already spent time figuring this out, just use useradd though an absolute path, because it is not in PATH by default in Amazon Linux 2.

/usr/sbin/useradd $YOUR_USER

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

4 participants