Quantcast
Channel: Active questions tagged dockerfile - DevOps Stack Exchange
Viewing all articles
Browse latest Browse all 136

Issue in copying files from base image to second image multistage

$
0
0

I am using multistage to reduce size of docker image and size of second image is reduced but when I try to run docker container from second image, I am retrieving no module found cv2. How would I solve this issue. My problem is that I do not know what files all need to be copied to the final Docker image. Thanks, help is highly appreciated. I tried squash but its not working

FROM tensorflow/tensorflow:1.8.0-py3 AS baseimageWORKDIR /srcRUN apt-get updateRUN apt-get install -y \    build-essential \    cmake \    git \    wget \    unzip \    yasm \    pkg-config \    libswscale-dev \    libtbb2 \    libtbb-dev \    libjpeg-dev \    libpng-dev \    libtiff-dev \    libjasper-dev \    libavformat-dev \    libhdf5-dev \    libpq-dev RUN pip3 --no-cache-dir install \ numpy \ hdf5storage \ h5py \ scipy \ py3nvmlWORKDIR /ENV OPENCV_VERSION="3.4.1"RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip \&& unzip ${OPENCV_VERSION}.zip \&& mkdir /opencv-${OPENCV_VERSION}/cmake_binary \&& cd /opencv-${OPENCV_VERSION}/cmake_binary \&& cmake -DBUILD_TIFF=ON \-DBUILD_opencv_java=OFF \-DWITH_CUDA=OFF \-DENABLE_AVX=ON \-DWITH_OPENGL=ON \-DWITH_OPENCL=ON \-DWITH_IPP=ON \-DWITH_TBB=ON \-DWITH_EIGEN=ON \-DWITH_V4L=ON \-DBUILD_TESTS=OFF \-DBUILD_PERF_TESTS=OFF \-DCMAKE_BUILD_TYPE=RELEASE \-DCMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") \-DPYTHON_EXECUTABLE=$(which python3) \-DPYTHON_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc;  print(get_python_inc())") \ -DPYTHON_PACKAGES_PATH=$(python3 -c "from distutils.sysconfig import get_python_lib;  print(get_python_lib())") .. \&& make install \&& rm /${OPENCV_VERSION}.zip \&& rm -r /opencv-${OPENCV_VERSION} RUN pip3 install -q keras==2.1.5 RUN pip3 install pyzmq RUN pip3 install pillow FROM python:3.8-slim RUN  mkdir -p /server/src WORKDIR /server/src COPY . ./ COPY --from=baseimage /src /server/src 

Viewing all articles
Browse latest Browse all 136

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>