Merge pull request #2383 from thaJeztah/support_mirrors

test/Dockerfile: allow using a mirror for the apt repository
This commit is contained in:
Joffrey F 2019-08-27 00:16:00 -07:00 committed by GitHub
commit 5660730d36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -8,11 +8,11 @@ clean:
.PHONY: build
build:
docker build -t docker-sdk-python -f tests/Dockerfile --build-arg PYTHON_VERSION=2.7 .
docker build -t docker-sdk-python -f tests/Dockerfile --build-arg PYTHON_VERSION=2.7 --build-arg APT_MIRROR .
.PHONY: build-py3
build-py3:
docker build -t docker-sdk-python3 -f tests/Dockerfile .
docker build -t docker-sdk-python3 -f tests/Dockerfile --build-arg APT_MIRROR .
.PHONY: build-docs
build-docs:

View File

@ -1,6 +1,11 @@
ARG PYTHON_VERSION=3.7
FROM python:${PYTHON_VERSION}
ARG APT_MIRROR
RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/apt/sources.list \
&& sed -ri "s/(security).debian.org/${APT_MIRROR:-security.debian.org}/g" /etc/apt/sources.list
RUN apt-get update && apt-get -y install \
gnupg2 \
pass \