I am new to ubuntu and I'm trying to create a docker image in ubuntu 16.04 using a dockerfile .


FROM ubuntu:16.04
MAINTAINER bill <bill@gmailcom>
RUN apt-get update
RUN apt-get install -y dh-python
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 
ENTRYPOINT ["python3" , "-u" , "webservice.py" ]

the line RUN apt-get install -y dh-pythonwas added because at first I would get the error

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:

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

but then after trying to build my image again I got a new error :

The following packages have unmet dependencies: dh-python : Depends: python3:any (>= 3.3.2-2~) but it is not installable E: Unable to correct problems, you have held broken packages. The command '/bin/sh -c apt-get install dh-python' returned a non-zero code: 100

I changed my default python version from 2.7 to 3.6.9 but still got the same error . I would appreciate your help with this issue . Thank you in advance


SOLUTION : Deleted all exited containers and removed the dh-python install from dockerfile and it worked

| improve this answer | |

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.