Linker in second Docker layer doesn't find shared OpenCV libraries built in previous layer, but files exist
问题 I'm trying to create a docker image with OpenCV 4.3 and my own C++ program linked against OpenCV, both built for Linux. Because building OpenCV takes quite a while and the resulting docker image is pretty large and I only need libopencv_core.so and libopencv_calib3d.so , I tried to create the following two layers : Build OpenCV from source and build my own C++ program that links against OpenCV Copy the shared OpenCV libraries and my compiled program created in the first build layer to the