Kaynağa Gözat

docker-py: use host-network for nested build of docker-py

When building this image docker-in-docker, the DNS in the environment
may not be usable for the build-container, causing resolution to fail:

```
02:35:31 W: Failed to fetch http://deb.debian.org/debian/dists/jessie/Release.gpg  Temporary failure resolving 'deb.debian.org'
```

This patch detects if we're building from within a container, and if
so, skips creating a networking namespace for the build by using
`--network=host`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3c15cea650e356f11550e435efa79bea4be88504)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 6 yıl önce
ebeveyn
işleme
9ad75d26fc
1 değiştirilmiş dosya ile 1 ekleme ve 0 silme
  1. 1 0
      hack/make/test-docker-py

+ 1 - 0
hack/make/test-docker-py

@@ -37,6 +37,7 @@ source hack/make/.integration-test-helpers
 		(
 			[ -n "${TESTDEBUG}" ] && set -x
 			[ -z "${TESTDEBUG}" ] && build_opts="--quiet"
+			[ -f /.dockerenv ] || build_opts="${build_opts} --network=host"
 			exec docker build ${build_opts} -t ${docker_py_image} -f tests/Dockerfile "https://github.com/docker/docker-py.git#${DOCKER_PY_COMMIT}"
 		)
 	fi