hvxl / otmonitor

Monitor tool for the OTGW (http://otgw.tclcode.com/)
GNU Lesser General Public License v3.0
27 stars 10 forks source link

Requirements to run #12

Closed basschipper closed 3 years ago

basschipper commented 3 years ago

Hi,

I'm updating my docker container to the new otmonitor version as-well. The previous image I created was based on some Python upstream image, which resulted in an image of ~900Mb. To lower the size I'm trying to build it on Alpine, but I think Alpine is missing some needed dependancies?

➜  ~ docker run -it alpine:3.12
/ # mkdir /app && mkdir /data \
>   && /usr/bin/wget http://otgw.tclcode.com/download/otmonitor-x64 -O /app/otmonitor \
>   && chmod +x /app/otmonitor
Connecting to otgw.tclcode.com (173.236.173.160:80)
saving to '/app/otmonitor'
otmonitor            100% |*********************************************************************************************************************************************| 5707k  0:00:00 ETA
'/app/otmonitor' saved
/ # /app/otmonitor --daemon
/bin/sh: /app/otmonitor: not found
/ #

Any idea?

hvxl commented 3 years ago

If you had run two more commands, you would have seen the problem:

/ # ldd /app/otmonitor
        /lib64/ld-linux-x86-64.so.2 (0x7f032dccd000)
        libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7f032dccd000)
        libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f032dccd000)
        libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f032dccd000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f032dccd000)
Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /app/otmonitor)
Error relocating /app/otmonitor: fts_close: symbol not found
Error relocating /app/otmonitor: fts_read: symbol not found
Error relocating /app/otmonitor: __register_atfork: symbol not found
Error relocating /app/otmonitor: fts_open: symbol not found
/ # ls -l /lib64/ld-linux-x86-64.so.2
ls: /lib64/ld-linux-x86-64.so.2: No such file or directory

OTmonitor was built against glibc. Apparently Alpine has a beef with glibc and uses something called musl instead. So your options seem to be:

This works:

~ docker run -it frolvlad/alpine-glibc
/ # mkdir /app && mkdir /data \
>   && /usr/bin/wget http://otgw.tclcode.com/download/otmonitor-x64 -O /app/otmonitor \
>   && chmod +x /app/otmonitor
Connecting to otgw.tclcode.com (173.236.173.160:80)
saving to '/app/otmonitor'
otmonitor            100% |********************************| 5707k  0:00:00 ETA
'/app/otmonitor' saved
/ # /app/otmonitor --version
Opentherm Monitor version 4.4.1
basschipper commented 3 years ago

Sorry, not such a Linux guru. But thank you very much, working nicely.