Docker Community Forums

Share and learn in the Docker community.

Build docker image works local but doesn't work on docker hub - cmake

I have created a simple Dockerfile and posted this on github.

When running this on my local machine (after docker system prune ) works fine

[ 76%] Building CXX object modules/cvv/CMakeFiles/opencv_cvv.dir/src/qtutil/matchview/keypointvaluechooser.cpp.o
[ 76%] Building CXX object modules/cvv/CMakeFiles/opencv_cvv.dir/src/qtutil/matchview/matchintervallselection.cpp.o
[ 76%] Building CXX object modules/cvv/CMakeFiles/opencv_cvv.dir/src/qtutil/matchview/matchmanagement.cpp.o
[ 76%] Building CXX object modules/cvv/CMakeFiles/opencv_cvv.dir/src/qtutil/matchview/matchportionselector.cpp.o
[ 76%] Building CXX object modules/aruco/CMakeFiles/opencv_aruco.dir/src/aruco.cpp.o
[ 77%] Linking CXX shared library ../../lib/
[ 77%] Building CXX object modules/cvv/CMakeFiles/opencv_cvv.dir/src/qtutil/matchview/matchscene.cpp.o
[ 77%] Built target opencv_xobjdetect
[ 77%] Processing OpenCL kernels (bioinspired)
Scanning dependencies of target opencv_bioinspired
[ 78%] Building CXX object modules/bioinspired/CMakeFiles/opencv_bioinspired.dir/src/basicretinafilter.cpp.o
[ 78%] Building CXX object modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dynafu_tsdf.cpp.o
[ 78%] Building CXX object modules/cvv/CMakeFiles/opencv_cvv.dir/src/qtutil/matchview/matchselectionselector.cpp.o
[ 78%] Building CXX object modules/cvv/CMakeFiles/opencv_cvv.dir/src/qtutil/matchview/matchsettingsselector.cpp.o

But when this is build bij docker-hub I get the follow error. Tried it already twice by triggering a build again, but doesn’t help.

[ 77%] Generating qrc_window_QT.cpp
[91mRCC: Error in '/opencv/opencv/modules/highgui/src/window_QT.qrc': Cannot find file 'files_Qt/Milky/48/28.png'
[91mmake[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/build.make:78: modules/highgui/qrc_window_QT.cpp] Error 1
[91mmake[1]: *** [CMakeFiles/Makefile2:4375: modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
[91mmake: *** [Makefile:163: all] Error 2
Removing intermediate container 7f068cac93e1
The command '/bin/sh -c make -j$(nproc)' returned a non-zero code: 2

I have checked opencv on git where that file is available.

Anyone what I do wrong?

Update 15-04-2020
I have now executed the same file not on my windows system but on my linux environment which also has docker. This is running debian 9.12 and Docker version 19.03.8. Also on this system the build is completed successfully. Yesterday I started it again on docker-hub and again same error.

i am also having build issues with docker hub, if i build locally on linux (slackware) using Docker version 19.03.5, build 633a0ea838 i have no issue, if i attempt to build on docker hub then i get an issue with makepkg and working directory:-


e[91m==> WARNING: Using existing $srcdir/ tree
==> Starting build()...
e[91mls: cannot access '.': Operation not permitted
configure: error: working directory cannot be determined
e[91m==> ERROR: A failure occurred in build().
Error making: makemkv

no idea where to go from here, it started happening around 4-5 days ago.

Thanks for sharing, now I know at least that I`m not the only one.

Same issue as @binhex here with

Locally it builds without any hiccups using Docker CE 19.03.9 and Podman 1.9.3. In Docker Hub I got:

Making all in NGStreams ...
e[91mls: cannot access '.': Operation not permitted
e[91mconfigure: error: working directory cannot be determined
e[91mmake[2]: *** [GNUmakefile.postamble:9: config.status] Error 2

UPDATE: This does NOT work. The build still failed and it only updated the timestamp of the existing image.

Found a solution:

Create a hooks/build file with the following contents:


docker build -f "$DOCKERFILE_PATH" -t "$IMAGE_NAME" .
docker push "$IMAGE_NAME"

(Details about hooks:

I suspect that by default Docker Hub now builds with some --cap-drop= which probably caused the issue.

@frederickzh you need to read this issue:-

the issue is statx which has been updated as part of coreutils, currently if you want to build using docker hub infrastructure the only workaround is to rollback the version of coreutils package (confirmed working)

1 Like