Skip to content

Issue a warning if $HOME is not writable by $USER #2097

@carver

Description

@carver

Edit: changed from "After setting USER, programs often expect ENV HOME to be set"

When switching USER in a Dockerfile, it would be awesome if Docker checked to see if the home directory exists, and if so: autorun this Dockerfile command:
ENV HOME /home/$(whoami)

I don't know linux/ubuntu user internals at all, but I imagine there are other automatically set variables that are getting missed, too.

$HOME being "/" bit me when trying to run a bower install, which expects $HOME to be a writeable directory, which / was not for my active user.

If setting $HOME is impractical or undesirable, a doc note in the USER section to also run an ENV HOME would be very helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions