Skip to content

In docs example use home dir as work dir - #270

Merged
chorrell merged 1 commit into
nodejs:masterfrom
davidbarton:patch-2
Nov 23, 2016
Merged

chorrell merged 1 commit into
nodejs:masterfrom
davidbarton:patch-2

Conversation

@davidbarton

Copy link
Copy Markdown

I think user home dir works better instead of -w "/usr/src/app" use -w "/home/node/app"

I think user home dir works better instead of `-w "/usr/src/app"` use `-w "/home/node/app"`
@davidbarton davidbarton changed the title In docs example change home dir for work dir In docs example use home dir as work dir Nov 15, 2016
@davidbarton

Copy link
Copy Markdown
Author

Ok I discovered there is no home dir created for node user. Which makes this irrelevant. Why don't we create home dir for node user?

@LaurentGoderre

Copy link
Copy Markdown
Member

We could add a WORKDIR directive which will create the path.

@pesho

pesho commented Nov 15, 2016

Copy link
Copy Markdown
Contributor

Ok I discovered there is no home dir created for node user. Which makes this irrelevant. Why don't we create home dir for node user?

@davidbarton there is a PR opened for that: #263

@LaurentGoderre

Copy link
Copy Markdown
Member

@pesho not quite, it doesn't create the path, just the user AFAIK

@LaurentGoderre

Copy link
Copy Markdown
Member

Someone else is asking for that though #263 (comment)

@LaurentGoderre

Copy link
Copy Markdown
Member

@pesho actually you seem to be right for the debian ones but I'm not sure it's creating it for the alpine one

@pesho

pesho commented Nov 15, 2016

Copy link
Copy Markdown
Contributor

@pesho not quite, it doesn't create the path, just the user AFAIK

@LaurentGoderre no, it does create the home directory, that's the main point of the PR (at least for the non-Alpine variants)

@LaurentGoderre

Copy link
Copy Markdown
Member

@pesho yeah, my bad, I thought it was mostly about the userid

@blueimp

blueimp commented Nov 15, 2016

Copy link
Copy Markdown
Contributor

The change in #263 does add a node home directory as well for the new Alpine variant.

@LaurentGoderre

Copy link
Copy Markdown
Member

@blueimp oh yeah? It does it automatically?

@blueimp

blueimp commented Nov 15, 2016

Copy link
Copy Markdown
Contributor

Yes, adduser in Alpine is the same as BusyBox' adduser, with the following method signature:

Usage: adduser [OPTIONS] USER [GROUP]

Create new user, or add USER to GROUP

    -h DIR      Home directory
    -g GECOS    GECOS field
    -s SHELL    Login shell
    -G GRP      Add user to existing group
    -S      Create a system user
    -D      Don't assign a password
    -H      Don't create home directory
    -u UID      User id
    -k SKEL     Skeleton directory (/etc/skel)

Since it's not a system user and doesn't use the "-H" argument, it does create a home directory.
The command used in #263 is adding the "-D" argument, since the user doesn't need a password assigned.
And it's setting the UID as explained in the pull request and the discussion here.

chorrell

This comment was marked as off-topic.

@SimenB

SimenB commented Nov 22, 2016

Copy link
Copy Markdown
Member

@chorrell it's landed, but not released. Still blocked?

@chorrell
chorrell merged commit 87b641c into nodejs:master Nov 23, 2016
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.

6 participants