0

I am new to Docker and trying to run a webserver written in Python. I am using Linux Debian running as virtual machine on a Windows host. I have mounted the required folder from my Windows host to the virtual machine. So when I make changes to the folder in Windows, the same change is reflected in my VM. The folder name is "resultsdb" and it contains all the Python files,etc. The folder contents are [in Debian VM] :

enter image description here

docker run hello-world is working successfully. I am using docker build -t resultsdb . (with a dot at the end) to build the Docker image. But I am getting the following error:

enter image description here

Please tell me where I am going wrong. Thanks !

Edit : The contents of Dockerfile are below :

##############################################################################
# Base image
##############################################################################
FROM centos:6.9 as resultsdbbase

# The CentOS package index for old releases has been moved...
RUN sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/CentOS-Base.repo && \
    sed -i 's/^#baseurl/baseurl/' /etc/yum.repos.d/CentOS-Base.repo && \
    sed -i 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/CentOS-Base.repo

RUN yum -y update && \
    yum -y install epel-release && \
    rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

RUN yum -y update && \
    yum -y install \
        python \
        mysql-libs \
        openldap \
        freetype \
        libpng \
    && yum clean all

##############################################################################
# Builder image
##############################################################################
FROM resultsdbbase as resultsdbbuilder

RUN yum -y update && \
    yum -y install \
        gcc \
        gcc-gfortran \
        gcc-c++ \
        python-devel \
        python-virtualenv \
        mysql-devel \
        openldap-devel \
        freetype-devel \
        libpng-devel \
    && yum clean all

COPY install /tmp/install

RUN cd /tmp/install; bash install.sh

##############################################################################
# Runtime image
##############################################################################
FROM resultsdbbase

RUN useradd -u 1000 testresults

COPY --from=resultsdbbuilder /appenv /appenv

WORKDIR /app

ENV PATH /appenv/bin:$PATH

COPY app /app

RUN python setup.py develop && python -m compileall /app/testresults

COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]

USER testresults

EXPOSE 8080
CMD ["serve"]

I've read that Docker has withdrawn support for CentOS.

3
  • could you please replace the screenshots with text that can be understood by search engines? It would help if you could provide the dockerfile too Commented May 3, 2023 at 13:56
  • @BruceBecker Please see the contents of Dockerfile. I think there may be some problem with the base image. Commented May 4, 2023 at 11:08
  • Centos 6 is end of life, that's your problem. If you're following a tutorial, try to find a more recent example, or update the Docker file yourself - this is a good exercise and pointing to a new version of Centos could be all you need.
    – Kate
    Commented May 5, 2023 at 15:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.