zivillian / ism7mqtt

GNU General Public License v3.0
57 stars 11 forks source link

Docker Parameter #104

Closed wrzlbrmft1 closed 6 months ago

wrzlbrmft1 commented 6 months ago

I tried to run ism7mqtt via docker, but there was a failure:

docker: Error response from daemon: create ./parameter.json: "./parameter.json" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.

What's the correct parameter? Where should the file parameter.json be located?

zivillian commented 6 months ago

what's the command you are using to run it via docker?

wrzlbrmft1 commented 6 months ago

I use it like this template docker run -d --restart=unless-stopped -v ./parameter.json:/app/parameter.json -e ISM7_MQTTHOST=<mqttserver> -e ISM7_IP=<ism7 ip/host> -e ISM7_PASSWORD=<ism7 password> zivillian/ism7mqtt:latest with my parameters of mqtt, hosts and password

zivillian commented 6 months ago

if I'm correct you need to use a bind mount. This is the relevant part of the docker compose I'm using:

    volumes: 
      - type: bind
        source: /opt/ism7-parameter.json
        target: /app/parameter.json

so something like docker run -d ... --mount type=bind,source="$(pwd)"/parameter.json,target=/app/parameter.json -e ... should work.

wrzlbrmft1 commented 6 months ago

. . . thanks a lot for this suggestion. I did it like this:

-v /home/<user>/parameter.json:/app/parameter.json

this works at the moment