Reputation: 566
I have a folder in an ubuntu VM called "MovieFlix" that contains a dockerfile a python flask app and a "templates" folder with html templates inside. I have managed to build a docker image with the same dockerfile successfully twice but I had to delete it in order to edit my python file . The third time I try to build my docker image the image is not build and I get
Package python3 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
dh-python
E: Package 'python3' has no installation candidate
The command '/bin/sh -c apt-get install -y python3 python3-pip' returned a non-zero code: 100
My DockerFile :
FROM ubuntu:16.04
MAINTAINER bill <bill@gmailcom>
RUN apt-get update
RUN apt-get install -y python3 python3-pip
RUN apt-get install -y bcrypt
RUN pip3 install flask pymongo flask_bcrypt
RUN pip3 install Flask-PyMongo py-bcrypt
RUN mkdir /app
RUN mkdir -p /app/templates
COPY webservice.py /app/webservice.py
ADD templates /app/templates
EXPOSE 5000
WORKDIR /app
ENTRYPOINT ["python3" , "-u" , "webservice.py" ]
I tried installing python3-pip but it is already installed in my ubuntu VM I would appreciate your help . Thank you in advance .
Upvotes: 0
Views: 1094
Reputation: 566
SOLVED : I deleted all inactive docker containers and build my image again with the same code
Upvotes: 0
Reputation: 2724
Run below commands in order :
1. sudo apt-get update
2. sudo apt-get install dh-python
Upvotes: 1