Closed purpleKarrot closed 5 years ago
Yes, that's why I recommend the use of the shell script, which mounts the home directory of your host to the home directory inside the container.
I think you misunderstood. I do use the shell script from this repository and it correctly mounts the home directory to /home
. But it does not set the $HOME
environment variable to that directory.
Adding the line -e HOME=$homedst \
in the shell script fixes the issue.
> docker run --rm -it --entrypoint /bin/bash sqitch/sqitch
sqitch@fcf30d54f372:/repo$ echo $HOME
/home
The default user for the Sqitch docker image is named sqitch
and its home is set to /home
here. If you run the script as root, however, it connects as root
instead of sqitch
here. This is as designed. Have I missed something?
The default user for the Sqitch docker image is named sqitch and its home is set to /home here.
Instead of using the default user, the shell script forwards the user id from the host here. The user sqitch
will be used if and only if the user id on the host is 1024
.
Consider this:
> docker run --rm -it -u 1000:985 --entrypoint /bin/bash sqitch/sqitch
I have no name!@bbc8b102fff9:/repo$ echo $HOME
/
Bah, I forgot that I changed that behavior in cd14783. Thanks, will fix.
Apparently,
HOME
is set to/
. Adding-e HOME=$homedst \
to thedocker run
command fixes the issue.