Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build error #1

Closed
wuziniu opened this issue Nov 3, 2021 · 6 comments
Closed

Docker build error #1

wuziniu opened this issue Nov 3, 2021 · 6 comments

Comments

@wuziniu
Copy link

wuziniu commented Nov 3, 2021

Hi, I'm new to docker and run into this problem when running sudo docker build:

Step 30/44 : WORKDIR /usr/local/include/opencv4/
---> Running in 2c0f16c18f84
Removing intermediate container 2c0f16c18f84
---> a32ddfa93f30
Step 31/44 : COPY --from=builder /usr/local/include/opencv4/ .
COPY failed: stat usr/local/include/opencv4/: file does not exist

How may I fix it?

@LukasBommes
Copy link
Owner

LukasBommes commented Nov 6, 2021

Hello wuziniu,
thanks for trying out my project.
I just built the docker image on a machine with Ubuntu 18.04 LTS and Docker CE 20.10.6, but could not reproduce your error above. Which OS and which docker version do you use?

However, I realized the mv-extractor was downloaded from an old repository. I updated this in the Dockerfile before building. Maybe, you can try again with the updated Dockerfile. Just clone this repo again before building, but checkout v1.0.1 this time (also see the updated readme).

If that fails again, you could delete all lines including the one where the error occurs in the Dockerfile, built the image, and run the container with the command stated in the readme. Then you can check, whether OpenCV was properly installed into "/usr/local/include/opencv4/", i.e. whether the directory is available and contains opencv. It should look like this

scs

@wuziniu
Copy link
Author

wuziniu commented Nov 9, 2021

Thanks for the reply. I'm building the docker image on Ubuntu 18.04 with docker version 20.10.10.
I tried your updated docker file and encountered the same problem and indeed OpenCV is not properly installed into "/usr/local/include/opencv4/" (nothing after ls).

There are a couple of suspicious warning and errors during docker build of Step 4/44 : (RUN cd $HOME && git clone -b "v1.0.0" https://github.com/LukasBommes/mv-extractor.git video_cap && cd video_cap && chmod +x install.sh && ./install.sh).

  1. Including three Download failure:
    -- xfeatures2d/boostdesc: Download: boostdesc_bgm_hd.i
    CMake Warning at /home/opencv/cmake/OpenCVDownload.cmake:193 (message):
    xfeatures2d/boostdesc: Download failed: 28;"Timeout was reached"

-- xfeatures2d/boostdesc: Download: boostdesc_binboost_064.i
CMake Warning at /home/opencv/cmake/OpenCVDownload.cmake:193 (message):
xfeatures2d/boostdesc: Download failed: 28;"Timeout was reached"

-- data: Download: face_landmark_model.dat
CMake Warning at /home/opencv/cmake/OpenCVDownload.cmake:193 (message):
data: Download failed: 28;"Timeout was reached"

  1. and the following fatal error:
    [ 85%] Building CXX object modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/src/boostdesc.cpp.o
    /home/opencv_contrib/modules/xfeatures2d/src/boostdesc.cpp:653:20: fatal error: boostdesc_bgm.i: No such file or directory
    #include "boostdesc_bgm.i"
    ^~~~~~~~~~~~~~~~~
    compilation terminated.
    modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/build.make:91: recipe for target 'modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/src/boostdesc.cpp.o' failed
    CMakeFiles/Makefile2:12567: recipe for target 'modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/all' failed
    make[2]: *** [modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/src/boostdesc.cpp.o] Error 1
    make[1]: *** [modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/all] Error 2
    Makefile:162: recipe for target 'all' failed
    make: *** [all] Error 2

@LukasBommes
Copy link
Owner

LukasBommes commented Nov 11, 2021

Hey wuziniu,

thanks for your patience with building my project! The download errors explain why OpenCV is not installed properly. While I don't know the reason for the timeouts, it has happened to other users of OpenCV and seems to be caused by network issues. See here or here. In both cases the problem is solved by manually downloading the respective files.
For easier debugging, I would recommend you install the mv-extractor instead of the mvmed-tracker. This correspons to step 4 you mention above (see 'install.sh' in the root directory of the mv-extractor). You can also remove everything from line 12 onwards in the Dockerfile of the mv-extractor (but keep the last line with the CMD statement).
You could also try building a newer version of OpenCV. For this, just update the version numbers in lines 60-67 in 'install.sh'.
It may also be worthwile opening an issue in OpenCV. Maybe, they can point out a potential issue with my build configuration that could cause the problem.

If nothing works, I can still provide you with my prebuilt docker container.

@wuziniu
Copy link
Author

wuziniu commented Nov 11, 2021

Thanks a lot. I'll try to do that.

@LukasBommes
Copy link
Owner

Welcome. I hope you get it to work.

@LukasBommes
Copy link
Owner

Closing due to inactivity. Feel free to reopen for further discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants