mcci-catena / docker-iot-dashboard

A complete IoT server for LoRaWAN IoT projects: node-red + influxdb + grafana + ssl + let's encrypt using docker-compose.
MIT License
101 stars 59 forks source link

not functional on raspberry Pi 3B + -- exec user process caused "exec format error" #12

Open xenek opened 6 years ago

xenek commented 6 years ago

Hi, can't seem to log an issue on my own fork of your repo, and I guess you'll be interested in this anyway. Cortex A53, ARM v8 architecture I believe.

Issue likely just that the Phusion base image is compiled for x64 not Arm variants (32 or 64 bit)

using HypriotOS v1.9.0

$ docker-compose build Building postfix Step 1/17 : FROM phusion/baseimage latest: Pulling from phusion/baseimage 281a73dee007: Pull complete 2aea1b77cff7: Pull complete 59a714b7d8bf: Pull complete 0218064da0a9: Pull complete ebac621dcea3: Pull complete a3ed95caeb02: Pull complete b580731643cc: Pull complete faa5fbdba239: Pull complete Digest: sha256:29479c37fcb28089eddd6619deed43bcdbcccf2185369e0199cc51a5ec78991b Status: Downloaded newer image for phusion/baseimage:latest ---> 166cfc3f6974 Step 2/17 : RUN apt-get update && apt-get install -y iputils-ping net-tools debconf-utils ---> Running in 72aa1fac7ca8 standard_init_linux.go:190: exec user process caused "exec format error" ERROR: Service 'postfix' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y iputils-ping net-tools debconf-utils' returned a non-zero code: 1 HypriotOS/armv7: pirate@black-pearl in ~/docker-ttn-dashboard $

Tips appreciated, I'm thinking of trying using https://hub.docker.com/r/armv7/armhf-baseimage/ which is based on Phusion, but it's pretty old. x

xenek commented 6 years ago

Hi, I tried the armhf-baseimage (trusty, I believe)

Lots of errors :)

$ docker-compose build Building postfix Step 1/17 : FROM armv7/armhf-baseimage latest: Pulling from armv7/armhf-baseimage 77078ceb36a9: Pull complete e312d1e2027f: Pull complete 5a949662b3d6: Pull complete 417ed9588a7d: Pull complete a3ed95caeb02: Pull complete b89982658e07: Pull complete 5cffb726e013: Pull complete Digest: sha256:f81cb85bd1f4cd3865b8b02f2fff8424c5d1a3ed466bdd3a1d92e72516769562 Status: Downloaded newer image for armv7/armhf-baseimage:latest ---> 45c8edfec0f1 Step 2/17 : RUN apt-get update && apt-get install -y iputils-ping net-to ols debconf-utils ---> Running in fb0f66b6895e Ign http://ports.ubuntu.com trusty InRelease Get:1 http://ports.ubuntu.com trusty-updates InRelease [65.9 kB] Get:2 http://ports.ubuntu.com trusty-security InRelease [65.9 kB] Get:3 http://ports.ubuntu.com trusty Release.gpg [933 B] Get:4 http://ports.ubuntu.com trusty Release [58.5 kB] Get:5 http://ports.ubuntu.com trusty-updates/main Sources [514 kB] Get:6 http://ports.ubuntu.com trusty-updates/restricted Sources [6449 B] Get:7 http://ports.ubuntu.com trusty-updates/universe Sources [252 kB] Get:8 http://ports.ubuntu.com trusty-updates/main armhf Packages [1122 kB] Get:9 http://ports.ubuntu.com trusty-updates/restricted armhf Packages [10.7 kB] Get:10 http://ports.ubuntu.com trusty-updates/universe armhf Packages [562 kB] Get:11 http://ports.ubuntu.com trusty-security/main Sources [198 kB] Get:12 http://ports.ubuntu.com trusty-security/restricted Sources [5050 B] Get:13 http://ports.ubuntu.com trusty-security/universe Sources [88.0 kB] Get:14 http://ports.ubuntu.com trusty-security/multiverse Sources [3013 B] Get:15 http://ports.ubuntu.com trusty-security/main armhf Packages [753 kB] Get:16 http://ports.ubuntu.com trusty-security/restricted armhf Packages [10.7 k B] Get:17 http://ports.ubuntu.com trusty-security/universe armhf Packages [277 kB] Get:18 http://ports.ubuntu.com trusty-security/multiverse armhf Packages [2155 B ] Get:19 http://ports.ubuntu.com trusty/main Sources [1335 kB] Get:20 http://ports.ubuntu.com trusty/restricted Sources [5335 B] Get:21 http://ports.ubuntu.com trusty/universe Sources [7926 kB] Get:22 http://ports.ubuntu.com trusty/main armhf Packages [1672 kB] Get:23 http://ports.ubuntu.com trusty/restricted armhf Packages [40 B] Get:24 http://ports.ubuntu.com trusty/universe armhf Packages [7393 kB] Fetched 22.3 MB in 1min 13s (304 kB/s) Reading package lists... Reading package lists... Building dependency tree... Reading state information... iputils-ping is already the newest version. net-tools is already the newest version. The following NEW packages will be installed: debconf-utils 0 upgraded, 1 newly installed, 0 to remove and 119 not upgraded. Need to get 57.4 kB of archives. After this operation, 157 kB of additional disk space will be used. Get:1 http://ports.ubuntu.com/ubuntu-ports/ trusty/main debconf-utils all 1.5.51 ubuntu2 [57.4 kB] debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (This frontend requires a controlling tty.) debconf: falling back to frontend: Teletype dpkg-preconfigure: unable to re-open stdin: Fetched 57.4 kB in 1s (38.4 kB/s) Selecting previously unselected package debconf-utils. (Reading database ... 13637 files and directories currently installed.) Preparing to unpack .../debconf-utils_1.5.51ubuntu2_all.deb ... Unpacking debconf-utils (1.5.51ubuntu2) ... Setting up debconf-utils (1.5.51ubuntu2) ... Removing intermediate container fb0f66b6895e ---> c6a5dc2cb0e5 Step 3/17 : ARG relay_ip ---> Running in 95917c5019ae Removing intermediate container 95917c5019ae ---> 20664eace0e9 Step 4/17 : ARG host_name ---> Running in cf7399576db6 Removing intermediate container cf7399576db6 ---> b403deaffc0d Step 5/17 : run echo "postfix postfix/mailname string $host_name" | debconf-set- selections ---> Running in dbbb0e374ac0 Removing intermediate container dbbb0e374ac0 ---> c11af6f6656d Step 6/17 : run echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections ---> Running in b51132fece93 Removing intermediate container b51132fece93 ---> 322d56d1fc95 Step 7/17 : run apt-get update && apt-get install -y postfix ---> Running in e3cd2879ada9 Ign http://ports.ubuntu.com trusty InRelease Hit http://ports.ubuntu.com trusty-updates InRelease Hit http://ports.ubuntu.com trusty-security InRelease Hit http://ports.ubuntu.com trusty Release.gpg Hit http://ports.ubuntu.com trusty Release Hit http://ports.ubuntu.com trusty-updates/main Sources Hit http://ports.ubuntu.com trusty-updates/restricted Sources Hit http://ports.ubuntu.com trusty-updates/universe Sources Hit http://ports.ubuntu.com trusty-updates/main armhf Packages Hit http://ports.ubuntu.com trusty-updates/restricted armhf Packages Hit http://ports.ubuntu.com trusty-updates/universe armhf Packages Hit http://ports.ubuntu.com trusty-security/main Sources Hit http://ports.ubuntu.com trusty-security/restricted Sources Hit http://ports.ubuntu.com trusty-security/universe Sources Hit http://ports.ubuntu.com trusty-security/multiverse Sources Hit http://ports.ubuntu.com trusty-security/main armhf Packages Hit http://ports.ubuntu.com trusty-security/restricted armhf Packages Hit http://ports.ubuntu.com trusty-security/universe armhf Packages Hit http://ports.ubuntu.com trusty-security/multiverse armhf Packages Hit http://ports.ubuntu.com trusty/main Sources Hit http://ports.ubuntu.com trusty/restricted Sources Hit http://ports.ubuntu.com trusty/universe Sources Hit http://ports.ubuntu.com trusty/main armhf Packages Hit http://ports.ubuntu.com trusty/restricted armhf Packages Hit http://ports.ubuntu.com trusty/universe armhf Packages Reading package lists... Reading package lists... Building dependency tree... Reading state information... The following extra packages will be installed: libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python python-minimal python2.7 python2.7-minimal ssl-cert Suggested packages: procmail postfix-mysql postfix-pgsql postfix-ldap postfix-pcre sasl2-bin libsasl2-modules dovecot-common postfix-cdb mail-reader ufw postfix-doc python-doc python-tk python2.7-doc binutils binfmt-support openssl-blacklist The following NEW packages will be installed: libpython-stdlib libpython2.7-minimal libpython2.7-stdlib postfix python python-minimal python2.7 python2.7-minimal ssl-cert 0 upgraded, 9 newly installed, 0 to remove and 119 not upgraded. Need to get 4576 kB of archives. After this operation, 17.6 MB of additional disk space will be used. Get:1 http://ports.ubuntu.com/ubuntu-ports/ trusty-updates/main libpython2.7-min imal armhf 2.7.6-8ubuntu0.4 [307 kB] Get:2 http://ports.ubuntu.com/ubuntu-ports/ trusty-updates/main python2.7-minima l armhf 2.7.6-8ubuntu0.4 [1039 kB] Get:3 http://ports.ubuntu.com/ubuntu-ports/ trusty-updates/main libpython2.7-std lib armhf 2.7.6-8ubuntu0.4 [1821 kB] Get:4 http://ports.ubuntu.com/ubuntu-ports/ trusty/main libpython-stdlib armhf 2 .7.5-5ubuntu3 [6984 B] Get:5 http://ports.ubuntu.com/ubuntu-ports/ trusty/main ssl-cert all 1.0.33 [16. 6 kB] Get:6 http://ports.ubuntu.com/ubuntu-ports/ trusty-updates/main postfix armhf 2. 11.0-1ubuntu1.2 [1027 kB] Get:7 http://ports.ubuntu.com/ubuntu-ports/ trusty-updates/main python2.7 armhf 2.7.6-8ubuntu0.4 [196 kB] Get:8 http://ports.ubuntu.com/ubuntu-ports/ trusty/main python-minimal armhf 2.7 .5-5ubuntu3 [27.4 kB] Get:9 http://ports.ubuntu.com/ubuntu-ports/ trusty/main python armhf 2.7.5-5ubun tu3 [134 kB] debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (This frontend requires a controlling tty.) debconf: falling back to frontend: Teletype dpkg-preconfigure: unable to re-open stdin: Fetched 4576 kB in 9s (487 kB/s) Selecting previously unselected package libpython2.7-minimal:armhf. (Reading database ... 13669 files and directories currently installed.) Preparing to unpack .../libpython2.7-minimal_2.7.6-8ubuntu0.4_armhf.deb ... Unpacking libpython2.7-minimal:armhf (2.7.6-8ubuntu0.4) ... Selecting previously unselected package python2.7-minimal. Preparing to unpack .../python2.7-minimal_2.7.6-8ubuntu0.4_armhf.deb ... Unpacking python2.7-minimal (2.7.6-8ubuntu0.4) ... Selecting previously unselected package libpython2.7-stdlib:armhf. Preparing to unpack .../libpython2.7-stdlib_2.7.6-8ubuntu0.4_armhf.deb ... Unpacking libpython2.7-stdlib:armhf (2.7.6-8ubuntu0.4) ... Selecting previously unselected package libpython-stdlib:armhf. Preparing to unpack .../libpython-stdlib_2.7.5-5ubuntu3_armhf.deb ... Unpacking libpython-stdlib:armhf (2.7.5-5ubuntu3) ... Selecting previously unselected package ssl-cert. Preparing to unpack .../ssl-cert_1.0.33_all.deb ... Unpacking ssl-cert (1.0.33) ... Selecting previously unselected package postfix. Preparing to unpack .../postfix_2.11.0-1ubuntu1.2_armhf.deb ... debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (This frontend requires a controlling tty.) debconf: falling back to frontend: Teletype Unpacking postfix (2.11.0-1ubuntu1.2) ... Selecting previously unselected package python2.7. Preparing to unpack .../python2.7_2.7.6-8ubuntu0.4_armhf.deb ... Unpacking python2.7 (2.7.6-8ubuntu0.4) ... Selecting previously unselected package python-minimal. Preparing to unpack .../python-minimal_2.7.5-5ubuntu3_armhf.deb ... Unpacking python-minimal (2.7.5-5ubuntu3) ... Selecting previously unselected package python. Preparing to unpack .../python_2.7.5-5ubuntu3_armhf.deb ... Unpacking python (2.7.5-5ubuntu3) ... Processing triggers for ureadahead (0.100.0-16) ... Processing triggers for mime-support (3.54ubuntu1.1) ... Setting up libpython2.7-minimal:armhf (2.7.6-8ubuntu0.4) ... Setting up python2.7-minimal (2.7.6-8ubuntu0.4) ... Linking and byte-compiling packages for runtime python2.7... Setting up libpython2.7-stdlib:armhf (2.7.6-8ubuntu0.4) ... Setting up libpython-stdlib:armhf (2.7.5-5ubuntu3) ... Setting up ssl-cert (1.0.33) ... debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (This frontend requires a controlling tty.) debconf: falling back to frontend: Teletype Setting up postfix (2.11.0-1ubuntu1.2) ... debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (This frontend requires a controlling tty.) debconf: falling back to frontend: Teletype Adding group postfix' (GID 107) ... Done. Adding system userpostfix' (UID 103) ... Adding new user postfix' (UID 103) with grouppostfix' ... Not creating home directory /var/spool/postfix'. Creating /etc/postfix/dynamicmaps.cf Adding tcp map entry to /etc/postfix/dynamicmaps.cf Adding sqlite map entry to /etc/postfix/dynamicmaps.cf Adding grouppostdrop' (GID 108) ... Done. setting myhostname: eb56a838e7c7 setting alias maps setting alias database changing /etc/mailname to . setting myorigin setting destinations: ., eb56a838e7c7, localhost.localdomain, localhost setting relayhost: setting mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 setting mailbox_size_limit: 0 setting recipient_delimiter: + setting inet_interfaces: all setting inet_protocols: all /etc/aliases does not exist, creating it. WARNING: /etc/aliases exists, but does not have a root alias.

Postfix is now set up with a default configuration. If you need to make changes, edit /etc/postfix/main.cf (and others) as needed. To view Postfix configuration values, see postconf(1).

After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.

Running newaliases invoke-rc.d: policy-rc.d denied execution of restart. Setting up python2.7 (2.7.6-8ubuntu0.4) ... Setting up python-minimal (2.7.5-5ubuntu3) ... Setting up python (2.7.5-5ubuntu3) ... Processing triggers for ureadahead (0.100.0-16) ... Processing triggers for libc-bin (2.19-0ubuntu6.6) ... Removing intermediate container e3cd2879ada9 ---> d732387ddff7 Step 8/17 : run postconf -e relayhost=$relay_ip ---> Running in ad88ffe4b707 Removing intermediate container ad88ffe4b707 ---> badb469145ef Step 9/17 : run postconf -e myhostname=$host_name ---> Running in c2a015bbb92f Removing intermediate container c2a015bbb92f ---> 09e93b55a7d9 Step 10/17 : run postconf -e smtp_generic_maps=hash:/etc/postfix/generic ---> Running in 82003ac90439 Removing intermediate container 82003ac90439 ---> c53e916144a6 Step 11/17 : run postconf -e mynetworks="127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1 ]/128 172.18.0.0/16" ---> Running in 3ea50e883d5d Removing intermediate container 3ea50e883d5d ---> 59977fcc6d11 Step 12/17 : run echo "root@aa7fde2ee7f1 iotmail@example.com" > /etc/postfix/gen eric ---> Running in 528b9345656f Removing intermediate container 528b9345656f ---> 973ff6bfb0df Step 13/17 : run postmap /etc/postfix/generic ---> Running in 5b55e4e8841f postmap: fatal: bad string length 0 < 1: mydomain = ERROR: Service 'postfix' failed to build: The command '/bin/sh -c postmap /etc/p ostfix/generic' returned a non-zero code: 1 HypriotOS/armv7: pirate@black-pearl in ~/docker-ttn-dashboard $

xenek commented 6 years ago

Ok, a few mods, and I' getting closer.

TTN_DASHBOARD_MAIL_RELAY_IP=127.0.0.1 TTN_DASHBOARD_MAIL_HOST_NAME=somedomain.com

After setting the above additional values in .env I now get this far. -same issue - need an Arm version of a node red container.

Building node-red Step 1/7 : FROM nodered/node-red-docker:0.16.2 0.16.2: Pulling from nodered/node-red-docker 9f0706ba7422: Pull complete d3942a742d22: Pull complete 62b1123c88f6: Pull complete 2dac6294ef18: Pull complete fd18c4867ed6: Pull complete c8b70cd3e56f: Pull complete d4638d709f75: Pull complete 4ed0b6e78187: Pull complete 83da6ec1533b: Pull complete 6638285fd3fb: Pull complete fcd0904971f7: Pull complete 7b50f5adf485: Pull complete a0d3cf8cb4f7: Pull complete Digest: sha256:eecdcc5bbc26eb1eca49e924c3bce32b6a86e34345d073a2facd2ce04680b67a Status: Downloaded newer image for nodered/node-red-docker:0.16.2 ---> c33f4e832830 Step 2/7 : ENV NODE_TLS_REJECT_UNAUTHORIZED=0 ---> Running in 129b662f8ed9 Removing intermediate container 129b662f8ed9 ---> a71f8e7d5587 Step 3/7 : RUN npm install node-red-contrib-influxdb ---> Running in 5c2419c46dce standard_init_linux.go:190: exec user process caused "exec format error" ERROR: Service 'node-red' failed to build: The command '/bin/sh -c npm install node-red-contrib-influxdb' returned a non-zero code: 1 HypriotOS/armv7: pirate@black-pearl in ~/docker-ttn-dashboard

xenek commented 6 years ago

Ok, good news, I have all running on the RPI, but for apache2 htpasswd and htgroup.

For me, this is where the complexity might exceed my time to find a solution - I can't get a terminal into the apache container as it's always shutting down, so I think I have to generate them locally then copy them in.

I've instructions here https://www.digitalocean.com/community/tutorials/how-to-set-up-password-authentication-with-apache-on-ubuntu-14-04 and here https://httpd.apache.org/docs/current/programs/htpasswd.html and here https://stackoverflow.com/questions/24553790/how-to-edit-docker-container-files-from-the-host it suggests I use $ docker cp CONTAINER:FILEPATH LOCALFILEPATH $ vi LOCALFILEPATH $ docker cp LOCALFILEPATH CONTAINER:FILEPATH

but a rapid path to a solution seems elusive.

xenek commented 6 years ago

Hm, helps if one reads the setup instructions ;-) I had to adapt them a bit, but they were sort of good.

I've all containers building and running with docker-compose on arm now on the Raspberry Pi 3b+, and apache SSL is working with the FQDN, I can get a title bar up for node red, but nothing for grafana or influx. I'll give it a rest and try again tomorrow or next year ;-) Cheers

xenek commented 6 years ago

Ok, grafana is good, just didn't like edge so much. I'll get real detail on issues if anyone's interested.

terrillmoore commented 6 years ago

Thanks for doing this work! Congratulations! Yes, we're interested and we're happy to support RPI as a host. Let us know the details....

terrillmoore commented 5 years ago

HI @xenek, I looked at your changes, and I think with @oliv3's contributions we might be ready to look at your setup as well. I don't see any checkins since May, did you get this working? The research you did is very helpful.

xenek commented 5 years ago

Hi, It's been long enough that I don't recall where I got up to, but I am pretty sure the above became a working Grafana stack. I'll review the Grafana system I built, and confirm if it's source was the above. x

terrillmoore commented 5 years ago

Now that I'm familiar with HypriotOS, I think I should be able to look at this and actually test. I'd strongly recommend using an external SSD rather than an SD card, though. I am also a bit worried that InfluxDB will want too much memory during its occasional garbage collects, but... I'll see if I have a chance to set something up.