OpenSprinkler / OpenSprinkler-Firmware

OpenSprinkler Unified Firmware for OpenSprinkler, OpenSprinkler Pi, and OpenSprinkler Beagle.
http://www.opensprinkler.com
GNU General Public License v3.0
474 stars 286 forks source link

Docker build failing on new fresh clone #306

Closed agnoam closed 3 months ago

agnoam commented 3 months ago

The docker image build is failing due to missing files in the repo.

Steps to reproduce:

  1. git clone https://github.com/OpenSprinkler/OpenSprinkler-Firmware
  2. following the steps in the repo's docker readme file

Exception dump:

$ docker build . -t opensprinkler

[+] Building 7.3s (17/27)                                                                                docker:default
 => [internal] load build definition from Dockerfile                                                               0.1s
 => => transferring dockerfile: 1.62kB                                                                             0.0s
 => [internal] load metadata for docker.io/library/debian:bookworm-slim                                            0.7s
 => [internal] load .dockerignore                                                                                  0.1s
 => => transferring context: 2B                                                                                    0.0s
 => [base 1/1] FROM docker.io/library/debian:bookworm-slim@sha256:5f7d5664eae4a192c2d2d6cb67fc3f3c7891a8722cd2903  0.0s
 => [internal] load build context                                                                                  0.7s
 => => transferring context: 2.86MB                                                                                0.5s
 => CACHED [raspi-gpio-build 1/9] RUN apt-get update                                                               0.0s
 => CACHED [stage-3 1/7] RUN apt-get update && apt-get install -y libstdc++6 libmosquittopp1                       0.0s
 => CACHED [stage-3 2/7] RUN rm -rf /var/lib/apt/lists/*                                                           0.0s
 => CACHED [stage-3 3/7] RUN mkdir /OpenSprinkler                                                                  0.0s
 => CACHED [stage-3 4/7] RUN mkdir -p /data/logs                                                                   0.0s
 => CANCELED [raspi-gpio-build 2/9] RUN apt-get install -y git gcc make automake                                   6.0s
 => CACHED [os-build 1/6] RUN apt-get update && apt-get install -y bash g++ make libmosquittopp-dev libssl-dev     0.0s
 => CACHED [os-build 2/6] RUN rm -rf /var/lib/apt/lists/*                                                          0.0s
 => [os-build 3/6] COPY . /OpenSprinkler                                                                           1.4s
 => [os-build 4/6] WORKDIR /OpenSprinkler                                                                          0.5s
 => [os-build 5/6] RUN make clean                                                                                  1.3s
 => ERROR [os-build 6/6] RUN make VERSION=OSPI                                                                     1.7s
------
 > [os-build 6/6] RUN make VERSION=OSPI:
0.763 g++ -std=gnu++14 -DOSPI -DSMTP_OPENSSL -Wall -include string.h -Iexternal/TinyWebsockets/tiny_websockets_lib/include -Iexternal/OpenThings-Framework-Firmware-Library/   -c -o main.o main.cpp
1.318 In file included from main.cpp:27:
1.318 OpenSprinkler.h:65:18: fatal error: OpenThingsFramework.h: No such file or directory
1.318    65 |         #include "OpenThingsFramework.h"
1.318       |                  ^~~~~~~~~~~~~~~~~~~~~~~
1.318 compilation terminated.
1.330 make: *** [<builtin>: main.o] Error 1
------
Dockerfile:30
--------------------
  28 |     WORKDIR /OpenSprinkler
  29 |     RUN make clean
  30 | >>> RUN make VERSION=${BUILD_VERSION}
  31 |
  32 |     ########################################
--------------------
ERROR: failed to solve: process "/bin/sh -c make VERSION=${BUILD_VERSION}" did not complete successfully: exit code: 2

Quick fix:

Just make sure the submodules are included. you can use git submodule update --recursive --init.