Trying to create a personal, openhab-cloud, docker instance - can't find ./config.json

I’ve been trying to set up a personal openhab-cloud instance using docker on on my linux web server and as yet have had no luck. Because my web server uses ports 443 and 80, the only change I had to make to the docker-compose.yml were the lines:

      - "3443:443"
      - "3080:80"
      - "11080:8080"

I followed the directions at: docker-compose/ and a fresh clone of the github repository, with no luck at all.

I have tried using the available docker images:

  1. Change directory to deployment/docker-compose
  2. Edit docker-compose.yml
  3. Edit .env
  4. docker-compose pull
  5. docker-compose up -d

And it can NEVER find “./config.json”. The other three containers seem to be up and ready, but never the openhab-cloud-app container.

I’ve tried every possible setting I can think of for the line in docker-compose.yml:

   - ./config.json.template:/opt/openhabcloud/config.json.template

Followed by a full rebuild of the docker system using “docker-compose down -v --rmi all”, deleting all docker images and starting fresh.

I understand what it’s supposed to be: to map host file “./config.json.template” to docker image file :/opt/openhabcloud/config.json.template.

I’ve tried mapping the template, I’ve tried mapping the config.json file directly…no dice. Can’t find “./config.json”.

I have tried building the docker image myself:

  1. Change directory to deployment/docker-compose
  2. Edit docker-compose.yml
  3. Edit .env
  4. docker-compose up -d

Same issue.

Having dug in further, I noticed that the pre-build image and the git-built image are different as well. The pre-built image runs “/bin/sh -c node app.js” directly and the git built image runs “./” to startup. So they are obviously NOT the same image. (Yes, I realize that “” just tries to create a config.json.template in the image, then runs the same command as the prebuilt image - I’m just pointing out that the two are out of sync anyway).

So, does anyone have any idea what I’m doing wrong?

Further down the rabbit hole, I will need to get the ports and certificates from Let’s Encrypt working, but that’s another issue.

Thanks for ANY ideas - I’m out of them.

I finally did figure out how to get past this hurdle by building the image myself (docker-compose build) and ficing up the docker-compose.yml file.

It turns out I was stumbling on a docker issue - To map a single host file into a docker container, the host file MUST have a full path name.

The original docker-compose.yml file on Github uses the line:

    - ./config.json.template:/opt/openhabcloud/config.json.template

When in fact it needed to be:

    - ${PWD}/config.json.template:/opt/openhabcloud/config.json.template

I ran across the same problem with the Traefik file:

    - ./traefik.toml:/etc/traefik/traefik.toml:ro

And needed to use ${PWD} to get a full path.

I can now at least get the openhab-cloud app RUNNING - still with problems relating to googleapis and apple apis.

Hopefully this will help someone in the future.

1 Like

If this is a bug a PR would be most welcome.

A PR has been sent.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.