Dockerfile build RUN cmd fails but interactive works

I’m running into an issue where building a Dockerfile fails at a ‘make’ command but if I run the container interactively and run the make it succeeds. Specifically the make command seems to be not seeing a file:
make[2]: *** No rule to make target /usr/local/nvidia/lib64/libcuda.so, needed by bin/gpu-example-alpha_comp. Stop.
But this is based on nvidia/cuda:8.0-cudnn5-devel and libcuda.so appears to exist, i.e. if I run -it the container:

root@cf5637b85467:/opt/opencv/opencv/build# ll /usr/local/nvidia/lib64/libcuda*.*
lrwxrwxrwx 1 999 999 17 Nov 21 20:42 /usr/local/nvidia/lib64/libcuda.so -> libcuda.so.370.28
lrwxrwxrwx 1 999 999 17 Nov 21 20:42 /usr/local/nvidia/lib64/libcuda.so.1 -> libcuda.so.370.28
-rw-r--r-- 2 root root 8219624 Sep 2 02:25 /usr/local/nvidia/lib64/libcuda.so.370.28
and make completes without issue if I manually run make (I tried running from both /bin/bash and /bin/sh).

The only thing I can see is the user & group 999 of the .so link, but I don’t know if that’s relevant. I’m not sure what to try at this point, any suggestions? Full Dockerfile would be below, but somehow it’s interpreted by the forum software as containing more than 2 “links”, so, I had to abridge it:
FROM nvidia/cuda:8.0-cudnn5-devel

apt-get stuff

pip stuff

# Install opencv and opencv_contrib
WORKDIR /opt/opencv
RUN git clone --depth 1 https://github.com/opencv/opencv.git &&
git clone --depth 1 https://github.com/opencv/opencv_contrib.git

RUN echo $LD_LIBRARY_PATH
WORKDIR /opt/opencv/opencv/build
RUN cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D INSTALL_C_EXAMPLES=ON
-D INSTALL_PYTHON_EXAMPLES=ON
-D OPENCV_EXTRA_MODULES_PATH=/opt/opencv/opencv_contrib/modules
-D CUDA_CUDA_LIBRARY=/usr/local/nvidia/lib64/libcuda.so
-D BUILD_EXAMPLES=ON …
RUN make -j8
RUN make install

Hi

This is a reply regarding issue i am too facing in Nvidia Jetson Tx2. I was not able to install Docker according to steps given in docker docs. I get the error “Package at docker.com does not support system architecture arm64” please guide me how to install Docker on Nvidia Jetson Tx2 which is ARMv8 processor.

Regards
Nagthej