Opencv2, gstreamer and nvenc/nvdec for python3 /usr/bin/ld: cannot find -lnvidia-encode


i want to compile opencv2, gstreamer and nvenc/nvdec for python3. I did it
many times on native host with success. Now i try to do the same thing on a
nvidia-docker container (nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04). I wrote
a dockerfile, mount and copy the necessary headers and start building.

Error for nvenc after running make :

CC libgstnvenc_la-gstnvh264enc.lo
cc1: warning: cnvenc: No such file or directory [-Wmissing-include-dirs]
/usr/bin/ld: cannot find -lnvidia-encode
collect2: error: ld returned 1 exit status
Makefile:832: recipe for target ‘’ failed
make: *** [] Error 1

Same on nvdec after running make :
/usr/bin/ld: cannot find -lnvcuvid

So the question is, how to get the libraries -nvcuvid and -lnvidia-encode.
On a native host , i got no problems at all

Did the same steps as you can see there:

Regards Martin

okay my workflow so far:

using a blank ubuntu: 18.04 container, CUDA 11.1 and cudnn 8

copy all cuda / cudnn stuff into the container and build it with no errors

really frustrating