AxisCommunications / acap-native-sdk-examples

Example code for APIs and features in AXIS Camera Application Platform (ACAP) Native SDK
Apache License 2.0
42 stars 24 forks source link

Trying to build the web-server example, has issues with docker #293

Open lbRaytec opened 1 week ago

lbRaytec commented 1 week ago

Hello, I am trying to work with the web-server example. I pulled the code from GitHub repo and executed the following Docker command to build the example.

docker build . --build-arg ARCH=armv7hf --tag web-server:armv7hf

The docker execution resulted in the following error.

`=> ERROR [ 6/10] RUN git apply --ignore-space-change --ignore-whitespace ../monkey.patch && . /opt/axis/acapsdk/envi 0.2s

[ 6/10] RUN git apply --ignore-space-change --ignore-whitespace ../monkey.patch && . /opt/axis/acapsdk/environment-setup* && ./configure --enable-shared --malloc-libc --prefix=/usr/local --bindir=/usr/local/bin --libdir=/usr/local/lib --sysconfdir=/usr/local/packages/list/html --datadir=/usr/local/packages/list/html --mandir=/usr/local/man --logdir=/tmp --plugdir=/usr/local/packages/list/lib --pidfile=/tmp/monkey.pid --incdir=/usr/local/include/monkey --systemddir=/usr/lib/systemd/system && make && make install: 0.217 error: corrupt patch at line 6

Dockerfile:15

14 | WORKDIR /opt/monkey 15 | >>> RUN git apply --ignore-space-change --ignore-whitespace ../monkey.patch &&\ 16 | >>> . /opt/axis/acapsdk/environment-setup* &&\ 17 | >>> ./configure \ 18 | >>> --enable-shared \ 19 | >>> --malloc-libc \ 20 | >>> --prefix=/usr/local \ 21 | >>> --bindir=/usr/local/bin \ 22 | >>> --libdir=/usr/local/lib \ 23 | >>> --sysconfdir=/usr/local/packages/list/html \ 24 | >>> --datadir=/usr/local/packages/list/html \ 25 | >>> --mandir=/usr/local/man \ 26 | >>> --logdir=/tmp \ 27 | >>> --plugdir=/usr/local/packages/list/lib \ 28 | >>> --pidfile=/tmp/monkey.pid \ 29 | >>> --incdir=/usr/local/include/monkey \ 30 | >>> --systemddir=/usr/lib/systemd/system &&\ 31 | >>> make &&\ 32 | >>> make install 33 |

ERROR: failed to solve: process "/bin/sh -c git apply --ignore-space-change --ignore-whitespace ../monkey.patch && . /opt/axis/acapsdk/environment-setup* && ./configure --enable-shared --malloc-libc --prefix=/usr/local --bindir=/usr/local/bin --libdir=/usr/local/lib --sysconfdir=/usr/local/packages/list/html --datadir=/usr/local/packages/list/html --mandir=/usr/local/man --logdir=/tmp --plugdir=/usr/local/packages/list/lib --pidfile=/tmp/monkey.pid --incdir=/usr/local/include/monkey --systemddir=/usr/lib/systemd/system && make && make install" did not complete successfully: exit code: 128`

Am I wrong with versions here because that's the only possible scenario I could think off. As, I have just pulled the code from example and trying to execute it.

TIA!

pataxis commented 4 hours ago

Hi @lbRaytec , thanks for your question.

The example builds and test pass in nightly tests, so more information about your system would be required to see if the problem can be replicated.

What OS and OS version are you using? Which version of Docker Desktop or Docker Engine are you using? Run docker --version and paste command and result here

Are you standing on main branch of this repository when building? Could you paste the SHA1 of last commit or run git log -1 and paste the command and output here?

Have you modified the web-server example?

lbRaytec commented 4 hours ago

Windows 11 version 23H2

Docker version

Docker version 27.2.0, build 3ab4256

last commit log:

commit bea36cadd81ca7a14ae0df52920018a5b94736a6 (HEAD -> main, origin/main, origin/HEAD)
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue Sep 17 15:40:17 2024 +0000

chore(deps): update super-linter/super-linter action to v7

No, I have not modified the example. did git clone <url>. Then, navigated into the web-server example and ran as per the documentation.

pataxis commented 4 hours ago

Are you using Docker Desktop for Windows and building there or are you using Windows Subsystem for Linux (WSL) with Ubuntu? I'm not completely familiar with Docker Desktop setup.

lbRaytec commented 4 hours ago

Navigated to web-server folder.

 set ARCH=armv7hf

Have to use set here because it is the windows alternate for export.

 docker build . --build-arg ARCH --tag web-server:ARCH

This gives me the error!

No, didn't use WSL. Although I have WSL , I didn't build there. Other examples like hello-world worked fine with Windows. Thus, I was optimistic that web-server would work as well.

pataxis commented 2 hours ago

Thanks for supplying more background. Just mentioning that there was a similar problem for applying patches in #85, but it was solved for Windows setup with WSL.

To troubleshoot, a thing that could be tested is to disable Buildkit to see if a newer version cause some issue DOCKER_BUILDKIT=0 docker build . --build-arg ARCH=armv7hf --tag web-server:armv7hf

If you have possibility to test on WSL, it would be interesting to know if that works better.