osrf / rocker

A tool to run docker containers with overlays and convenient options for things like GUIs etc.
Apache License 2.0
576 stars 75 forks source link

`$HOME` environment incorrect in container #131

Closed galou closed 3 years ago

galou commented 3 years ago

When I run rocker --user --home tiryoh/ros-melodic-desktop, the /home/gael directory is created, the user gael is created but $HOME points to /home/ubuntu.

Beware, the docker image is quite large but I don't know which other smaller image would reproduce the issue.

tfoote commented 3 years ago

That's an interesting behavior. Something must be changing or setting the $HOME variable. I would look at the Dockerfile and the entrypoint scripts to debug.

I found what appears to be the Dockerfile for that image and you appear to be setting it explicitly

If you set it in your Dockerfile it will override the default which is picked up from your user's defaults. If explicitly set we don't want to override it unless the user explicitly sets it again.

In general that whole user section would probably be better to not be baked into the image.