sqitchers / docker-sqitch

Docker Image packaging for Sqitch
MIT License
35 stars 39 forks source link

Config file is expected in /.config #11

Closed purpleKarrot closed 5 years ago

purpleKarrot commented 5 years ago

Apparently, HOME is set to /. Adding -e HOME=$homedst \ to the docker run command fixes the issue.

theory commented 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.

purpleKarrot commented 5 years ago

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.

theory commented 5 years ago
 > 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?

purpleKarrot commented 5 years ago

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
/
theory commented 5 years ago

Bah, I forgot that I changed that behavior in cd14783. Thanks, will fix.