Context
I had a dockerfile based on postgres:11-alpine
that was working in the past (probably a few months since it was last built) with the following definition:
FROM postgres:11-alpine
RUN apk update
# install aws cli
# taken from: https://github.com/anigeo/docker-awscli/blob/master/Dockerfile
RUN \
apk -Uuv add groff less python py-pip && \
pip install awscli && \
apk --purge -v del py-pip && \
rm /var/cache/apk/*
I recently tried to rebuild it before upgrading to postgres 12, but the image build failed with:
ERROR: unsatisfiable constraints:
python (missing):
required by: world[python]
I guess the python
package is gone now because YOLO? Whatever, I tried to upgrade to python3
by changing the docker file to:
RUN \
apk -Uuv add groff less python3 py-pip && \
pip install awscli && \
apk --purge -v del py-pip && \
rm /var/cache/apk/*
This looked like it worked, but then when running the aws
command it failed with error:
ModuleNotFoundError: No module named 'six'
Question
How to fix this so the awscli
will not give the error No module named 'six'
?
The problem seems to actually be caused by deleting py-pip
.
As far as I know, the aim of the apk del
was to reduce the size of the final docker image. I'm not sure why deleting py-pip
used to work when the file was using the python
package.
So the following now seems to be working:
RUN \
apk -Uuv add groff less python3 py-pip && \
pip install awscli && \
rm /var/cache/apk/*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With