Add PIP extra index URLs

This commit is contained in:
Gabriele De Rosa 2021-11-26 12:44:25 +01:00
parent b1ba5cf3f2
commit 35de8e84c6
2 changed files with 10 additions and 2 deletions

View File

@ -15,11 +15,12 @@ RUN apk update --no-cache \
&& ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime \
# Remove tmp files
&& rm -rf /tmp/* /var/tmp/* \
# Add PiWheels support
&& echo "[global]\nextra-index-url=https://www.piwheels.org/simple" >> /etc/pip.conf \
# Upgrade PIP
&& python3 -m pip install --no-cache-dir --upgrade pip
# Copy PIP extra index URLs
COPY pip.conf
# Copy requirements
COPY requirements.txt .
@ -27,6 +28,8 @@ COPY requirements.txt .
RUN apk update --no-cache \
# Install tmp packages
&& apk add --no-cache --virtual build-deps gcc python3-dev musl-dev \
# Add PIP extra index URLs
&& mv pip.conf /etc/pip.conf \
# Install PIP packages
&& python3 -m pip install --no-cache-dir -r requirements.txt \
# Delete tmp packages

5
pip.conf Normal file
View File

@ -0,0 +1,5 @@
[global]
index-url = https://alpine-wheels.github.io/index
extra-index-url = https://pypi.python.org/simple
https://pypi.org/simple
https://www.piwheels.org/simple