Skip to content

Commit

Permalink
Adding proxies while using docker to dev build
Browse files Browse the repository at this point in the history
Signed-off-by: Weixiao Huang <[email protected]>
  • Loading branch information
weixiao-huang authored and alxiord committed Nov 30, 2018
1 parent b0163cb commit fe563aa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/devtool
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,14 @@ run_devctr() {
[[ -t 0 ]] && docker_args+=("-i")
[[ -t 1 ]] && docker_args+=("-t")

# Try to pass these environments from host into container for network proxies
proxies=(http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY)
for i in "${proxies[@]}"; do
if [[ ! -z ${!i} ]]; then
docker_args+=("--env") && docker_args+=("$i=${!i}")
fi
done

# Finally, run the dev container
#
docker run "${docker_args[@]}" \
Expand Down

0 comments on commit fe563aa

Please sign in to comment.