Closed t0bst4r closed 1 month ago
Hi, is actually made on purpose to speed up the loading. It's clear that if you want to run matterbride building the docker image, it doesn't work for you. I could add some param like -build to solve it eventually... but there are other part of the startup where I intentionally don't await. I'm interested in the docker image with alpine. I tried a lot of time but the best I could make was: FROM alpine:3.18.4 as base
Then actually takes 30 minutes to build on all the archs: linux/amd64,linux/arm64,linux/arm/v7 Also just have node 18 so ... not really the best. Were you been able to do better with alpine? Can you share the link of your Docker file if you made better ?
I opened a discussion since is not an issue making a HA integration. https://github.com/Luligu/matterbridge/discussions/39
Maybe we don’t need a -build
option, but an -init
option. That would be more understandable, isn’t it?
Here is the dockerfile: https://github.com/t0bst4r/matterbridge-home-assistant-addon/blob/main/docker/Dockerfile
It’s still WIP, and as you see it’s also using node-18. I‘ve had the same issue and several other people, too.
Quote from Home Assistant:
Main reason for this, is because in Alpine 3.19 shipped with NodeJS v20, which, at the time of writing, could not be used on armv7 when building Docker images. This is caused by a QEMU bug, which has been known since 2020.
Can we move on the discussion ?
The
matterbridge -add
commands expectsglobalModulesDirectory
to be already set when adding a new plugin. This blocks adding plugins before starting the bridge for the first time.I am currently building an alpine docker image using my newly created
matterbridge-home-assistant
plugin. Therefore I want to install and add the plugin before starting the bridge.At the moment I have two options to solve this:
run
timeout 5s matterbridge -bridge
during the docker build process. This starts the bridge and creates all the storage files. After 5 seconds it gets killed. Then theglobalModulesDirectory
is available.Create the storage entry by hand using
Instead matterbridge should be able to add plugins before starting for the first time. This will probably implicitly work, when the
globalModulesDirectory
is determined correctly. For me it looks like having an await here could already fix the problem.