-1

here is my docker compose yml file:

version: "3.3"
services:
   tutorial: 
    image: fiware/tutorials.context-provider
    hostname: iot-sensors
    container_name: fiware-tutorial
    networks:
        - default
    expose:
        - "3000"
        - "3001"
    ports:
        - "3000:3000"
        - "3001:3001"
    environment:
        - "DEBUG=tutorial:*"
        - "PORT=3000"
        - "IOTA_HTTP_HOST=iot-agent"
        - "IOTA_HTTP_PORT=7896"
        - "DUMMY_DEVICES_PORT=3001"
        - "DUMMY_DEVICES_API_KEY=4jggokgpepnvsb2uv4s40d59ov"

And this the result:docker-compose.yml execution

Why cant i run it on Raspberry PI3( OS Linux 11 Debian bullseye)? Please help! Thank you very much for your time!

1 Answers1

0

As the error message suggests, you are hitting an exec format error when trying to run the dockerization of the fiware/tutorials.context-provider on a Raspberry PI since the compiled binaries are based on the amd64 architecture.

As can be seen from the answer to this question, that won't work on an ARM based machine, since Docker is a virtualisation platform, not an emulator.

Since no image based on your architecture is currently available, if you need it, you will have to build an ARM version yourself. The current code and Dockerfile can be found here: https://github.com/FIWARE/tutorials.NGSI-v2/tree/master/docker

So I would assume you will need to amend the dockerization and rebuild the binaries to overcome the exec format error issue - this seems to be a commons Issue with Raspberry Pi.

However I'm still unsure why creating a ARM dockerization is necessary, as all you are attempting to do is to containerize and run code emulating dummy IoT devices on a Raspberry Pi. A Raspberry Pi itself can send a stream of data directly as a real device - it doesn't need a device emulator to be a device, it is one.

Jason Fox
  • 5,115
  • 1
  • 15
  • 34
  • I figured it out,i can simulate a sensor using python and mqtt without any problem, also i simulated the data to be in JSON format, temperature sensor. – elmagico555 Jun 27 '22 at 12:30