Docker build for arm64 trips over gflags #387
-
I am building a simple docker image for linux/arm64 on a linux/amd64 host. I am using the latest image from ifm: I have tried adding (sudo) apt-get install libgflags-dev two different ways (see Dockerfile). One way fails to find the package the other takes me down a rabbit hole of dependencies. I'm looking for suggestions how to solve this problem, please. Here is my dockerfile: FROM ghcr.io/ifm/ifm3d:stable WORKDIR /msclient.d WORKDIR build ###ENTRYPOINT ["/bin/bash", "-l"] Here is my CMakeLists.txt: cmake_minimum_required (VERSION 3.13) project (MSClient VERSION 0.1.0) find_package (glog CONFIG REQUIRED PATHS /usr/lib/cmake) find_package (ifm3d CONFIG REQUIRED COMPONENTS device framegrabber) add_subdirectory(ms.d) add_subdirectory(app.d) target_link_libraries (${APP_TARGET} PUBLIC |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hi @KtGunn, Are you using glog in your app? It seems like this error might not be related to ifm3d. We typically do not need to install libgflags-dev to run applications using ifm3d. Maybe you can provide the full output of your build command? |
Beta Was this translation helpful? Give feedback.
-
Well the first thing I notice is you are not specifying the architecture you want in the base ifm3d image. Since you are building on linux/amd64, it will default to the docker image for this architecture. You should specify the architecture, for instance use: But I don't think this will chance anything to the glog dependency issue. I think these should already be in the base image, but to be sure can you try adding |
Beta Was this translation helpful? Give feedback.
-
I just gave the build a try, and I am able to build a c++ application from this minimal example:
$ docker build --no-cache --file docker/ifm-robotics/example/Dockerfile .
[+] Building 113.1s (10/10) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 416B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 107B 0.0s
=> [internal] load metadata for ghcr.io/ifm/ifm3d:v1.1.1-ubuntu-arm64 0.5s
=> CACHED [1/5] FROM ghcr.io/ifm/ifm3d:v1.1.1-ubuntu-arm64@sha256:3cba3f7c1ed492793f8a139100e2f8cf9a0114c 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 1.58kB 0.0s
=> [2/5] RUN sudo apt update && sudo apt install -y build-essential cmake coreuti 80.2s
=> [3/5] COPY examples/o3r/ifm3d_playground /home/ifm/ifm3d_playground 0.0s
=> [4/5] WORKDIR /home/ifm/ifm3d_playground/build 0.0s
=> [5/5] RUN cmake .. && cmake --build . 31.1s
=> exporting to image 1.3s
=> => exporting layers 1.3s
=> => writing image sha256:f856ce39a3c0595cd288352a78d33fb971861dca43e667f339653d7e34e656a7 0.0s Maybe you can start with this, adding components one at a time so we can understand exactly which dependency is causing issues. |
Beta Was this translation helpful? Give feedback.
I just gave the build a try, and I am able to build a c++ application from this minimal example:
$ docker build --no-cache --file docker/ifm-robotics/example/Dockerfile . [+] Building 113.1s (10/10) FINISHED …