-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker image configuration is not working as described #56
Comments
I can't start Docker either. What do i have to do?
|
Right, the environment variables used to build the container are only used during the build step and can't be passed later on. Having an entrypoint script that essentially does the same thing as the line in the Dockerfile that creates the To get it running in the meantime, you can create the |
I will think of a better way to supply the configuration at runtime. Seems this is bothering too many people at this point. |
I have a first draft in #61. It will simply override anything that's in the toml file (or not) at startup when it is defined in environment variables. Not super elegant, but should get the job done. |
I was wondering whether you could use something like this: https://github.com/softprops/envy, but I guess it's a bit tricky to do with the separate structs |
Oh, that one is interesting. Thanks for sharing. |
Why not simply use a Docker Compose file and assign the configuration file? ` services: |
Using environment variables for configuring containers is a best practice: https://12factor.net/config |
It looks like there's also a typo in this config :D It should be After changing to |
Typo has been fixed in the latest main branch. Thanks again for reporting. |
…etter readable * Fixed putting values from environment variables to config.toml * fixes DennisOSRM#56
Hello everyone, first of all, thank you very much @DennisOSRM for the short-term implementation of a solution for all those troubled with HMS-xxxxW-2T. config.toml: inverter_host = "xxx.xxx.xxx.xxx"
coop_mode = true # that the s-miles cloud is working
update_interval = 60500 # Should not less than 60500
#[home_assistant]
#host = "xxx.xxx.xxx.xxx"
#username = ""
#password = ""
#port = 188x
[simple_mqtt]
host = "xxx.xxx.xxx.xxx"
username = ""
password = ""
port = 188x compose.yaml: version: "3.3"
services:
hms-mqtt-publisher:
image: dennisosrm/hms-mqtt-publisher
restart: unless-stopped
volumes:
- ./config.toml:/config.toml
networks: {} |
Hello, I have the same problem:
Can someone help me and tell me where the problem is? |
Sorry for asking, but I can't get any further with tsfuchs' advice. |
This sounds like the config.toml file is either not existing or not at the correct path |
Hello @thielepaul, thank you very much for your support. It's almost embarrassing, but the config.toml was in a config.toml folder. |
…etter readable * Fixed putting values from environment variables to config.toml * fixes DennisOSRM#56
I just tested the docker image and the configuration through env variables is not working yet.
Looking at your dockerfile (https://github.com/DennisOSRM/hms-mqtt-publisher/blob/main/Dockerfile#L38) it looks like this line should be part of an entrypoint script instead of being executed during build with
RUN
.I can also create a PR if you are interested.
The text was updated successfully, but these errors were encountered: