Docker Community Forums

Share and learn in the Docker community.

Trying to create a home-assistant container


(Futuretense) #1

Preface: I am very new to docker, so please excuse me if I’m using the wrong terminology at times. (feel free to educate me!) I value your time and in the hope that I get some great answers I spent several hours writing the following three questions, trying to make everything detailed and clear as possible.


My setup

I have a Intel NUC mini PC running Windows 10 and have HyperV and Docker for Windows installed. I want to create a home-assistant container. I used Kitematic to create a home-assistant container. The repository I used to create the container is:

https://hub.docker.com/r/homeassistant/home-assistant/

Q1) Is this this correct repo to use for my setup?


Using just the command line

After the container installed I was able to use the GUI to map ports, as well as specify the volume where I store my home assistant config files and I can use the service by browsing to the specified port.

Q2) How can I set up the container on my own using the command line? Kitematic did a lot of stuff for me, but I’m not sure what. I think I would be better off learning how to set this up from the command line. I looked at the docker pull command and the full description from the link above, but it was very confusing. For example it said to ..code::bash. Not only do I not know what that means, it doesn’t work in my powershell. Maybe these instructions aren’t for docker for windows, but I have no way of telling.


Even with the container Kitematic created, I’d like for the container to automatically start when the docker service starts, so I issued the following command in PowerShell:

docker update --restart=always mycontainer

And this is where it gets weird. When I restart the docker service the container does start, but it is not seeing the configuration files that are mapped to c:\docker\home-assistant. The container is acting as if it doesn’t find any configuration files and it appears it is creating default entries somewhere (where they are stored I have no idea). I can tell it is not using my files because I changed the value for the title of the application. Additionally it is requiring me to create a new user account which is stored in c:\docker\home-assistant_v2.db

However when I restart the docker service and then issue:

docker container restart home-assistant

The container restarts and sees my configuration files. So it appears the restart policy is behaving differently than the restart command.

Q3) How can I get the container home-assistant to start when the docker service starts and load the correct configuration files?