Skip to content

Commit 5660730

Browse files
authored
Merge pull request #2383 from thaJeztah/support_mirrors
test/Dockerfile: allow using a mirror for the apt repository
2 parents 33b430a + 5a91c2e commit 5660730

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ clean:
88

99
.PHONY: build
1010
build:
11-
docker build -t docker-sdk-python -f tests/Dockerfile --build-arg PYTHON_VERSION=2.7 .
11+
docker build -t docker-sdk-python -f tests/Dockerfile --build-arg PYTHON_VERSION=2.7 --build-arg APT_MIRROR .
1212

1313
.PHONY: build-py3
1414
build-py3:
15-
docker build -t docker-sdk-python3 -f tests/Dockerfile .
15+
docker build -t docker-sdk-python3 -f tests/Dockerfile --build-arg APT_MIRROR .
1616

1717
.PHONY: build-docs
1818
build-docs:

tests/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
ARG PYTHON_VERSION=3.7
22

33
FROM python:${PYTHON_VERSION}
4+
5+
ARG APT_MIRROR
6+
RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/apt/sources.list \
7+
&& sed -ri "s/(security).debian.org/${APT_MIRROR:-security.debian.org}/g" /etc/apt/sources.list
8+
49
RUN apt-get update && apt-get -y install \
510
gnupg2 \
611
pass \

0 commit comments

Comments
 (0)