Dockerfile_Django REST_ERROR _Cannot卸载'six'。这是一个distutils安装

时间:2018-04-17 07:35:28

标签: python django docker dockerfile

Docker Django REST API Build因错误而停滞

Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

在此处更新了完整的堆栈跟踪/日志 - https://github.com/digital-cognition-co-in/Django_REST_API_with_OpenCV_on_HEROKU

enter image description here

我的Dockerfile -

#
FROM ubuntu:xenial

RUN apt-get update 

RUN apt-get install -y python3 # install python3

RUN apt-get install -y python-pip python-dev build-essential

# Make and Change to DIR - dck1 (MKDIR + WORKDIR)
#
COPY ./REST_CV /usr/src/rest_api/
WORKDIR /usr/src/rest_api/
#
RUN ls
#
RUN pwd
# Docker has default "sh" Shell and Conda prefers a "bash" shell 
#
#RUN ["/bin/bash", "-c", " git clone https://github.com/digital-cognition-co-in/Statistical-Model-Management-Framework"]
# Above for Testing only 

# Install CURL
RUN apt-get install -y --no-install-recommends vim nano git wget curl
# Install miniconda to /miniconda
RUN curl -LO http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
RUN bash Miniconda-latest-Linux-x86_64.sh -p /miniconda -b
RUN ls ## Will Show file == Miniconda-latest-Linux-x86_64.sh
RUN rm Miniconda-latest-Linux-x86_64.sh
RUN ls ## To check we have removed file == Miniconda-latest-Linux-x86_64.sh
ENV PATH=/miniconda/bin:${PATH}
RUN conda update -y conda
#
#
RUN ["/bin/bash", "-c", "conda create -n docker_opencv_venv python=3.5"]
RUN ["/bin/bash", "-c", "source activate docker_opencv_venv"]
#
#COPY ./requirements.txt /usr/src/rest_api/requirements.txt ## If we want to Copy only a Single File
#
#RUN find requirements.txt ## If we want to "find" a file within same DIR 
#
#RUN pip install --no-cache-dir -r requirements.txt 
### We want the PACKAGES to be CACHED on the Docker DIR
#
RUN pip install --upgrade pip
RUN pip install -r /usr/src/rest_api/requirements.txt
#
EXPOSE 8000
#
RUN ls
RUN pwd
#
CMD ["python", "manage.py", "migrate"]
#
# Error --- python: can't open file 'manage.py': [Errno 2] No such file or directory
#
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
#

正如Jerin所说,我上面发布了我的Dockerfile。

0 个答案:

没有答案