firo: Local docker image fails to build

I’m trying to build the Dockerfile in this repostiroy, but the process fails:

[+] Building 1679.9s (17/19)                                                                                                                                                                                            
 => [internal] load .dockerignore                                                                                                                                                                                  0.0s
 => => transferring context: 1.56kB                                                                                                                                                                                0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                                               0.0s
 => => transferring dockerfile: 1.72kB                                                                                                                                                                             0.0s
 => [internal] load metadata for docker.io/library/debian:bullseye                                                                                                                                                 2.4s
 => [internal] load metadata for docker.io/library/debian:bullseye-slim                                                                                                                                            2.4s
 => CACHED [build-image 1/7] FROM docker.io/library/debian:bullseye@sha256:63d62ae233b588d6b426b7b072d79d1306bfd02a72bff1fc045b8511cc89ee09                                                                        0.0s
 => CACHED [stage-1 1/7] FROM docker.io/library/debian:bullseye-slim@sha256:f4da3f9b18fc242b739807a0fb3e77747f644f2fb3f67f4403fafce2286b431a                                                                       0.0s
 => [internal] load build context                                                                                                                                                                                  1.0s
 => => transferring context: 562.02kB                                                                                                                                                                              0.9s
 => [build-image 2/7] RUN apt-get update && apt-get install -y     automake     bsdmainutils     curl     g++     libtool     make     pkg-config     patch                                                       50.9s
 => [build-image 3/7] COPY . /tmp/firo/                                                                                                                                                                            0.2s 
 => [build-image 4/7] WORKDIR /tmp/firo                                                                                                                                                                            0.4s 
 => [build-image 5/7] RUN cd depends &&     NO_QT=true make HOST=$(uname -m)-linux-gnu -j$(nproc)                                                                                                                487.5s 
 => [build-image 6/7] RUN ./autogen.sh &&     ./configure --without-gui --enable-tests --prefix=/tmp/firo/depends/$(uname -m)-linux-gnu &&     make -j$(nproc) &&     make check &&     make install            1136.0s 
 => [build-image 7/7] RUN mkdir /tmp/ldd &&     ./depends/ldd_copy.sh -b "./depends/$(uname -m)-linux-gnu/bin/firod" -t "/tmp/ldd" &&     ./depends/ldd_copy.sh -b "./depends/$(uname -m)-linux-gnu/bin/firo-cli"  0.9s 
 => [stage-1 2/7] COPY --from=build-image /usr/bin/firod /usr/bin/firod                                                                                                                                            0.1s 
 => [stage-1 3/7] COPY --from=build-image /usr/bin/firo-cli /usr/bin/firo-cli                                                                                                                                      0.1s 
 => [stage-1 4/7] COPY --from=build-image /tmp/ldd /tmp/ldd                                                                                                                                                        0.1s 
 => ERROR [stage-1 5/7] RUN cp --verbose -RT /tmp/ldd / &&     rm -rf /tmp/ldd &&     ldd /usr/bin/firod                                                                                                           0.4s 
------                                                                                                                                                                                                                  
 > [stage-1 5/7] RUN cp --verbose -RT /tmp/ldd / &&     rm -rf /tmp/ldd &&     ldd /usr/bin/firod:                                                                                                                      
------
Dockerfile:43
--------------------
  42 |     # restore ldd files in correct paths
  43 | >>> RUN cp --verbose -RT /tmp/ldd / && \
  44 | >>>     rm -rf /tmp/ldd && \
  45 | >>>     ldd /usr/bin/firod
  46 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c cp --verbose -RT /tmp/ldd / &&     rm -rf /tmp/ldd &&     ldd /usr/bin/firod" did not complete successfully: exit code: 135

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 18 (18 by maintainers)

Most upvoted comments

PR here https://github.com/firoorg/firo/pull/1251, thanks for the report. I am using same build process on my other c++ projects, I will use this fix in more places.

Based on the logs it fails after start of copy /tmp/ldd/lib/x86_64-linux-gnu/libc.so.6. There might be a problem when overriding ciritcal libraries like libc/libstdc++ which cp command is also using when running.

change command to cp -vrnT (-n do not overwrite an existing file https://man7.org/linux/man-pages/man1/cp.1.html)

this doesn’t override libraries that are already present in *-slim image.

I am 99% certain that this fixes it because firod has only standard libraries, so essentially nothing will be copied 😄. But it will take into account future shared libraries that could be added.