3cky / mbusd

Open-source Modbus TCP to Modbus RTU (RS-232/485) gateway.
BSD 3-Clause "New" or "Revised" License
575 stars 219 forks source link

Docker build failing #101

Closed jpmeijers closed 9 months ago

jpmeijers commented 9 months ago

git clone https://github.com/3cky/mbusd.git cd mbusd/

$ docker build .
[+] Building 14.5s (9/10)                                        docker:default
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 376B                                       0.0s
 => [internal] load metadata for docker.io/library/alpine:latest           0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => CACHED [build 1/5] FROM docker.io/library/alpine:latest                0.0s
 => [internal] load build context                                          0.1s
 => => transferring context: 1.19MB                                        0.0s
 => [build 2/5] RUN apk add --no-cache alpine-sdk cmake                   12.8s
 => [build 3/5] COPY . /mbusd                                              0.1s 
 => [build 4/5] WORKDIR /mbusd/build                                       0.0s 
 => ERROR [build 5/5] RUN cmake -DCMAKE_INSTALL_PREFIX=/usr .. && make &&  1.3s 
------                                                                          
 > [build 5/5] RUN cmake -DCMAKE_INSTALL_PREFIX=/usr .. && make && make install:
0.313 -- The C compiler identification is GNU 12.2.1                            
0.379 -- The CXX compiler identification is GNU 12.2.1                          
0.393 -- Detecting C compiler ABI info                                          
0.460 -- Detecting C compiler ABI info - done                                   
0.480 -- Check for working C compiler: /usr/bin/cc - skipped
0.480 -- Detecting C compile features
0.481 -- Detecting C compile features - done
0.486 -- Detecting CXX compiler ABI info
0.557 -- Detecting CXX compiler ABI info - done
0.573 -- Check for working CXX compiler: /usr/bin/c++ - skipped
0.573 -- Detecting CXX compile features
0.574 -- Detecting CXX compile features - done
0.584 -- Could NOT find UnixCommands (missing: BASH) 
0.592 -- Checking for module 'systemd'
0.594 --   Package 'systemd', required by 'virtual:world', not found
0.594 -- Looking for cfmakeraw
0.661 -- Looking for cfmakeraw - found
0.661 -- Looking for cfsetspeed
0.729 -- Looking for cfsetspeed - found
0.729 -- Looking for cfsetispeed
0.800 -- Looking for cfsetispeed - found
0.800 -- Looking for TIOCSRS485
0.870 -- Looking for TIOCSRS485 - found
0.871 -- Looking for time
0.942 -- Looking for time - found
0.942 -- Looking for localtime
1.017 -- Looking for localtime - found
1.017 -- Passing HRDATE to compiler space
1.018 -- Looking for tty_get_name in util
1.096 -- Looking for tty_get_name in util - not found
1.096 -- Looking for uu_lock in util
1.173 -- Looking for uu_lock in util - not found
1.200 -- Install prefix      /usr
1.200 -- Install bindir:     /usr/bin
1.200 -- Install sysconfdir: /etc
1.200 -- Install datadir:    /usr/share
1.200 -- Configuring done (0.9s)
1.207 -- Generating done (0.0s)
1.208 -- Build files have been written to: /mbusd/build
1.239 [  8%] Building C object CMakeFiles/mbusd.dir/src/main.c.o
1.262 In file included from /mbusd/src/cfg.h:39,
1.262                  from /mbusd/src/main.c:37:
1.262 /mbusd/src/tty.h:38:10: fatal error: linux/serial.h: No such file or directory
1.262    38 | #include <linux/serial.h>
1.262       |          ^~~~~~~~~~~~~~~~
1.262 compilation terminated.
1.263 make[2]: *** [CMakeFiles/mbusd.dir/build.make:76: CMakeFiles/mbusd.dir/src/main.c.o] Error 1
1.263 make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/mbusd.dir/all] Error 2
1.263 make: *** [Makefile:166: all] Error 2
------
Dockerfile:5
--------------------
   3 |     COPY . /mbusd
   4 |     WORKDIR /mbusd/build
   5 | >>> RUN cmake -DCMAKE_INSTALL_PREFIX=/usr .. && make && make install
   6 |     
   7 |     FROM alpine:latest AS scratch
--------------------
ERROR: failed to solve: process "/bin/sh -c cmake -DCMAKE_INSTALL_PREFIX=/usr .. && make && make install" did not complete successfully: exit code: 2
jpmeijers commented 9 months ago

Related, with some ideas: https://github.com/serialport/node-serialport/issues/1706