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

USER $HOME uses uid instead of username #333

Closed
hobti01 opened this issue Sep 3, 2018 · 0 comments
Closed

USER $HOME uses uid instead of username #333

hobti01 opened this issue Sep 3, 2018 · 0 comments
Assignees
Labels
kind/bug Something isn't working

Comments

@hobti01
Copy link

hobti01 commented Sep 3, 2018

It seems that $HOME is set to the value of the USER instruction.

This causes problems with OpenShift compatible images

the final USER declaration in the Dockerfile should specify the user ID (numeric value) and not the user name

Using the uid causes unexpected behaviour:

USER 1000

RUN touch ~/invalid

output

INFO[0051] cmd: /bin/sh                                 
INFO[0051] args: [-c touch ~/invalid]                   
touch: cannot touch '/home/1000/invalid': No such file or directory
Error: error building image: waiting for process to exit: exit status 1

Workaround is to set $HOME explicitly with ARG or ENV, but it would be great if $HOME was resolved to the users $HOME.

Thanks for the great work!

@hobti01 hobti01 changed the title USER $HOME USER $HOME uses uid instead of username Sep 3, 2018
@priyawadhwa priyawadhwa added the kind/bug Something isn't working label Sep 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants