I'm brand new to Docker and have been trying to containerize my Django application. Whenever I run docker-compose up
, I get:
=> ERROR [ 6/15] RUN pip3 install -r requirements.txt 0.2s
------
> [ 6/15] RUN pip3 install -r requirements.txt:
#10 0.207 /bin/sh: pip3: not found
Dockerfile
FROM python:3.9-alpine
# Add scripts to PATH of running container
ENV PATH='/scripts:${PATH}:/sbin'
# Packages required on alpine in order to install uWSGI server used to run
# Django application in production
RUN apk update
RUN apk add --update --no-cache --virtual .tmp gcc libc-dev linux-headers
RUN apk add python3
RUN apk add py3-pip
RUN pip3 install -r requirements.txt
I ran docker run -i -t alpine /bin/sh
in my shell and, when I ran apk add python3
, I verified that it does not provide pip
, so I install pip
and tried pip install ...
and it successfully installed package. However, these commands do not seem to work in my Dockerfile. How can I fix this?
I have tried running pip install
, pip3 install
, py-pip install
, and py3-pip install
, and nothing works.