From 168c4aa3c8bd3eb73262be3b9b33c506144498a6 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Fri, 2 Mar 2018 19:14:24 +0000 Subject: [PATCH] Docker: use host network for build and none for running pegleg This PS updates the pegleg script to build and run the docker image/container with host networking/no networking - enabling it to be used seamlessly on k8s hosts that do not make use of dockers iptables rules. Change-Id: Ia08b805f79ec8f82f3555856f316921f7eddb064 --- tools/pegleg.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/pegleg.sh b/tools/pegleg.sh index 21819fd1..01c6ce90 100755 --- a/tools/pegleg.sh +++ b/tools/pegleg.sh @@ -18,12 +18,12 @@ IMAGE_PEGLEG=${IMAGE_PEGLEG:-quay.io/attcomdev/pegleg:latest} if [[ -z ${http_proxy} && -z ${https_proxy} ]] then - docker build -q --rm -t "${IMAGE_PEGLEG}" "${SOURCE_DIR}" > /dev/null + docker build --network=host -q --rm -t "${IMAGE_PEGLEG}" "${SOURCE_DIR}" > /dev/null else - docker build -q --rm -t "${IMAGE_PEGLEG}" --build-arg http_proxy=${http_proxy} --build-arg https_proxy=${https_proxy} "${SOURCE_DIR}" > /dev/null + docker build --network=host -q --rm -t "${IMAGE_PEGLEG}" --build-arg http_proxy=${http_proxy} --build-arg https_proxy=${https_proxy} "${SOURCE_DIR}" > /dev/null fi -docker run --rm -t \ +docker run --net=none --rm -t \ -v "${WORKSPACE}:/var/pegleg" \ "${IMAGE_PEGLEG}" \ pegleg "${@}"