Confused by file-structure of docker image

I’m a bit confused by the file structure of the docker image. The brewpi directory is in /home/brewpi but the directory brewpi-tools is in the root user’s home directory (/root). As such, for the longest time I couldn’t even find brewpi-tools (and hence the update script). Is is this intentional, or perhaps did I cause this by using a sudo somewhere when I shouldn’t have while setting up brewpi?

root@c58bfe7a3eaf:~# ls /home
brewpi
root@c58bfe7a3eaf:~# ls ~/
brewpi-tools
root@c58bfe7a3eaf:~# ls /root
brewpi-tools

It’s like this because before we moved to docker, the brewpi-tools directory was in the pi user’s dir and the script in the brewpi user’s dir.

We don’t have a pi user in docker, so it is now in the root user’s home directory. I think we should eventually remove brewpi-tools, because that was mainly written for a non-docker install. Updating with docker is easier by just pulling an updated image.

Got it. Is there a way to preserve the data and logs when pulling a new docker image? Or should I be manually backing them up and replacing them?

The data directory is a symlink to a mapped volume on the host. The data is not stored inside the container.

Ah perfect, thanks. I obviously have not spent much time understanding docker…