zewelor / bt-mqtt-gateway

A simple Python script which provides a Bluetooth to MQTT gateway, easily extensible via custom workers. See https://github.com/zewelor/bt-mqtt-gateway/wiki for more information.
MIT License
548 stars 116 forks source link

Update Docker images on Docker Hub #196

Closed dbluxo closed 3 years ago

dbluxo commented 3 years ago

Hey, could you please :pray: update the Docker images on Docker Hub? The platform arm32v7 does not seem to include PRs https://github.com/zewelor/bt-mqtt-gateway/pull/170 & https://github.com/zewelor/bt-mqtt-gateway/pull/172.

dbluxo commented 3 years ago

When I want to build it locally, the Docker build breaks even though I created a config.yaml:

Traceback (most recent call last):
  File "./gateway.py", line 22, in <module>
    from config import settings
  File "/application/config.py", line 4, in <module>
    with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "config.yaml"), "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/application/config.yaml'
ERROR: You must give at least one requirement to install (see "pip help install")
The command '/bin/sh -c apk add --no-cache --virtual build-dependencies git bluez-dev musl-dev make gcc glib-dev musl-dev &&     pip install `./gateway.py -r all`                                                                 &&     apk del build-dependencies' returned a non-zero code: 1
zewelor commented 3 years ago

Updated and fixed that bug in docker build.

dbluxo commented 3 years ago

Hi @zewelor, after pulling your newest Docker image I now get this error:

Start in debug mode
Traceback (most recent call last):
  File "./gateway.py", line 64, in <module>
    from config import settings
  File "/application/config.py", line 4, in <module>
    with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "config.yaml"), "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/application/config.yaml'
Gateway died...

My docker-compose.yaml:

version: '3'
services:
  mi-scale:
    image: zewelor/bt-mqtt-gateway:latest@sha256:a8f3fbafa05fcccb767d5fc94723d26762bb26ff5694540529e89a26565c358d
    container_name: bt-mqtt-gateway
    restart: unless-stopped
    network_mode: host
    environment:
    - DEBUG=true
    volumes:
      - ${PWD}/config.yaml:/config.yaml
    logging:
        driver: "json-file"
        options:
            max-size: "5m"
            max-file: "5"
gingerlime commented 3 years ago

Same here. When I tried to map ${PWD}/config.yaml:/application/config.yaml then it fails with There is no config.yaml! An example is created. and it dies as well.

gingerlime commented 3 years ago

tried to work around it by mapping both /config.yaml and /application/config.yaml to the same file, and it seems to start, but then fails with a different error (not sure if it's related)

docker run --name bt-mqtt-gateway --network=host -v $PWD/config.yaml:/config.yaml -v $PWD/config.yaml:/application/config.yaml zewelor/bt-mqtt-gateway
Start in normal mode
10:31:25 Starting
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
10:31:27 Adding 1 ruuvitag devices
10:31:27 Updating 1 ruuvitag devices
Can't down device hci0: Operation not permitted (1)
Can't down device hci0: Operation not permitted (1)
Can't down device hci0: Operation not permitted (1)
Can't down device hci0: Operation not permitted (1)
10:31:35 Finish current jobs and shut down. If you need force exit use kill
zewelor commented 3 years ago

@dbluxo It should be fixed in newest image.

dbluxo commented 3 years ago

@zewelor thank you!