doc(Docker): document running in Docker#120
Conversation
|
Why are you running this in Docker? batmon supports all mayor operating systems. And whats the reason building this from The Dockerfile is meant to be for HA add-on interface. HA chooses the right base image, see I don't recommend running batmon in Docker anyway. Better to run this directly on the host, it doesn't open any port. |
All my production workloads are portable, decoupled from host environment, using isolated environments and lightweight.
Obviously I tried to adopt the existing blueprint. I remember some weird dependencies to S7 and it seems |
|
EDIT: sorry I narco-bumped this, I didn't realize it was from 2023 @bentolor I also run it under docker since through decades of admin experience I have leaned to shy away from non-package manager installs of software on multi-purpose servers. Here is a repo which does a multi-platform build script: https://github.com/sashasimkin/batmon-docker. I'm not sure if it would be good to port that to this repo or if the maintainer doesn't want automatic builds for some reason to update the other. I found I had to override the command in docker compose since the initialization script seems to break pretty hard when just moving over to bash as the interpreter, what was your experience? |
|
@brilthor no worries. Just my 2c: Eventually I resorted to using an ESP32 with ESPHome and github://Fabian-Schmidt/esphome-victron_ble which worked quickly, out of the box and quite reliably the past years. |
Make addon_main.sh bashio-optional so the same Dockerfile builds both the HA add-on and a standalone image (BUILD_FROM=alpine). A new entrypoint.sh dispatches on /usr/bin/with-contenv. Publish ghcr.io/fl4p/batmon-ha (amd64/arm64/armv7) and add a Helm chart. Community images that ran addon_main.sh by rewriting its shebang to /bin/sh silently disabled bumble/bluek/esphome and always used bleak. Fixes: - MQTT_HOST/PORT/USER/PASSWORD from `docker run -e` were overwritten with empty strings when no Supervisor MQTT service was present - options.json without ble_stack skipped the pairing pre-step instead of defaulting to bleak - a failing pair-only step was swallowed on the non-bashio path - docker stop now terminates promptly (entrypoint execs python) - add .dockerignore so a local build no longer bakes options.json credentials in
|
Thanks for kicking this off. I ended up shipping standalone Docker support in a way that keeps a single Note your patch targeted |
|
And notice that I implemented two new bluetooth stacks in batmon, bluek (DBus bypass) and bumble (exclusive adapter access). |
While I failed to get the setup running for me (I have a SmartSolar and it seems it uses a different approach, See https://community.victronenergy.com/questions/187303/victron-bluetooth-advertising-protocol.html. And my LifePO4 BMS seems to be out of bluetooth reach), I still documented the necessary steps for clarity.
Watch out my change in
run.sh. No clue how this is supposed to run.