0

I'm trying to build a Centos Docker Image to run NFIQ-2. It has the docker file listed above.

################################################################################
#
#   Builder environnement
#
################################################################################

FROM centos as builder
LABEL maintainer "Marco.DeDonno@unil.ch"
RUN sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf
ADD NFIQ2.tgz /

RUN yum update && \
    yum upgrade -y

RUN yum group install -y "Development Tools" && \
    yum install -y cmake

RUN cd /NFIQ2/libOpenCV && \
    cmake -D CMAKE_MAKE_PROGRAM=make /NFIQ2/OpenCV/

RUN make -C /NFIQ2/libOpenCV \
    opencv_core opencv_ts opencv_imgproc opencv_highgui opencv_flann \
    opencv_features2d opencv_calib3d opencv_ml opencv_video opencv_objdetect \
    opencv_contrib opencv_nonfree opencv_gpu opencv_photo opencv_stitching opencv_videostab

RUN make -C /NFIQ2/NFIQ2/

ENV LD_LIBRARY_PATH=/NFIQ2/biomdi/common/lib:/NFIQ2/biomdi/fingerminutia/lib:/NFIQ2/libOpenCV/lib

################################################################################
#
#   Running environnement
#
################################################################################

FROM centos

COPY --from=builder /NFIQ2/NFIQ2/bin/ /NFIQ2/NFIQ2/bin/
COPY --from=builder /NFIQ2/biomdi/common/lib/ /NFIQ2/biomdi/common/lib/
COPY --from=builder /NFIQ2/biomdi/fingerminutia/lib/ /NFIQ2/biomdi/fingerminutia/lib/
COPY --from=builder /NFIQ2/libOpenCV/lib/ /NFIQ2/libOpenCV/lib/

COPY --from=builder /NFIQ2/complianceTestSet/ /NFIQ2/complianceTestSet/

ENV LD_LIBRARY_PATH=/NFIQ2/libOpenCV/lib:/NFIQ2/biomdi/common/lib:/NFIQ2/biomdi/fingerminutia/lib

Still when I run it I cannot seem to find the packages on the repos:

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
The command '/bin/sh -c yum update &&     yum upgrade -y' returned a non-zero code: 1

The maintainer of the package says the repos yum is getting for me miss the files but how do I select other repos in the docker image?

0

Changing the update command did the trick to just RUN yum update:

FROM centos as builder
LABEL maintainer "Marco.DeDonno@unil.ch"
RUN sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf
ADD NFIQ2.tgz /

#RUN yum update && \
#    yum upgrade -y
RUN  yum update

RUN yum group install -y "Development Tools" && \
    yum install -y cmake

RUN cd /NFIQ2/libOpenCV && \
    cmake -D CMAKE_MAKE_PROGRAM=make /NFIQ2/OpenCV/

RUN make -C /NFIQ2/libOpenCV \
    opencv_core opencv_ts opencv_imgproc opencv_highgui opencv_flann \
    opencv_features2d opencv_calib3d opencv_ml opencv_video opencv_objdetect \
    opencv_contrib opencv_nonfree opencv_gpu opencv_photo opencv_stitching opencv_videostab

RUN make -C /NFIQ2/NFIQ2/

ENV LD_LIBRARY_PATH=/NFIQ2/biomdi/common/lib:/NFIQ2/biomdi/fingerminutia/lib:/NFIQ2/libOpenCV/lib

################################################################################
#
#   Running environnement
#
################################################################################

FROM centos

COPY --from=builder /NFIQ2/NFIQ2/bin/ /NFIQ2/NFIQ2/bin/
COPY --from=builder /NFIQ2/biomdi/common/lib/ /NFIQ2/biomdi/common/lib/
COPY --from=builder /NFIQ2/biomdi/fingerminutia/lib/ /NFIQ2/biomdi/fingerminutia/lib/
COPY --from=builder /NFIQ2/libOpenCV/lib/ /NFIQ2/libOpenCV/lib/

#COPY --from=builder /NFIQ2/complianceTestSet/ /NFIQ2/complianceTestSet/

ENV LD_LIBRARY_PATH=/NFIQ2/libOpenCV/lib:/NFIQ2/biomdi/common/lib:/NFIQ2/biomdi/fingerminutia/lib

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.