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
This commit is contained in:
parent
bf9e121f6f
commit
168c4aa3c8
@ -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 "${@}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user