Add proxy options to docker run portions of image build

Updates the Makefile and associated shell scripts that perform docker
run to utilize proxy info.

Change-Id: Ic37ae9bc25500357f980ed327148eacac7555915
changes/18/573818/2
Bryan Strassner 4 years ago
parent 5b1189db6e
commit 6a6e3ec46e
  1. 2
      Makefile
  2. 20
      tools/airflow_image_run.sh
  3. 9
      tools/shipyard_image_run.sh

@ -74,7 +74,7 @@ tests:
.PHONY: run
run:
$(SCRIPT) $(IMAGE)
USE_PROXY=$(USE_PROXY) PROXY=$(PROXY) $(SCRIPT) $(IMAGE)
.PHONY: build_airflow
build_airflow:

@ -15,12 +15,22 @@
#
set -x
IMAGE=$1
TEST_RESP="$(docker run \
-p 8080:8080 \
--name airflow_test ${IMAGE} \
quicktest)"
USE_PROXY=${USE_PROXY:-false}
if [ "${USE_PROXY}" == "true" ]; then
TEST_RESP="$(docker run \
-p 8080:8080 \
--env HTTP_PROXY="${PROXY}" \
--env HTTPS_PROXY="${PROXY}" \
--name airflow_test ${IMAGE} \
quicktest)"
else
TEST_RESP="$(docker run \
-p 8080:8080 \
--name airflow_test ${IMAGE} \
quicktest)"
fi
docker stop airflow_test
docker rm airflow_test

@ -16,6 +16,7 @@
set -x
IMAGE=$1
USE_PROXY=${USE_PROXY:-false}
# Collect necessary files and run shipyard image in docker
mkdir -p build/.tmprun/etc
@ -29,9 +30,13 @@ docker run \
sleep 5
RESULT="$(curl -i 'http://127.0.0.1:9000/versions' | tr '\r' '\n' | head -1)"
RESULT="$(curl -i 'http://127.0.0.1:9000/versions' --noproxy '*' | tr '\r' '\n' | head -1)"
CLI_RESULT="$(docker run -t --rm --net=host ${IMAGE} help | tr '\r' '\n' | head -1)"
if [ "${USE_PROXY}" == "true" ]; then
CLI_RESULT="$(docker run -t --rm --net=host --env HTTP_PROXY="${PROXY}" --env HTTPS_PROXY="${PROXY}" ${IMAGE} help | tr '\r' '\n' | head -1)"
else
CLI_RESULT="$(docker run -t --rm --net=host ${IMAGE} help | tr '\r' '\n' | head -1)"
fi
docker stop shipyard_test
docker rm shipyard_test

Loading…
Cancel
Save