Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

use proxy vars if set for build#4275

Open
garthy wants to merge 1 commit intodocker-archive-public:masterfrom
garthy:use_http_proxy_for_build
Open

use proxy vars if set for build#4275
garthy wants to merge 1 commit intodocker-archive-public:masterfrom
garthy:use_http_proxy_for_build

Conversation

@garthy
Copy link
Copy Markdown

@garthy garthy commented Oct 9, 2017

Use any http_proxy variables that are set for the image build when building in a container
Signed-off-by: Garth Bushell garth@garthy.com

Signed-off-by: Garth Bushell <garth@garthy.com>
Copy link
Copy Markdown
Contributor

@dgageot dgageot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the code easier to read

fi

docker build -t $DOCKER_IMAGE_NAME .
if [[ ${http_proxy:+x} ]]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use substitution here and not if [[ -n ${http_proxy} ]]?

DOCKER_BUILD_ARGS="${DOCKER_BUILD_ARGS} --build-arg http_proxy"
fi

if [[ ${https_proxy:+x} ]]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

DOCKER_BUILD_ARGS="${DOCKER_BUILD_ARGS} --build-arg https_proxy"
fi

if [[ ${no_proxy:+x} ]]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here


DOCKER_IMAGE_NAME="docker-machine-build"
DOCKER_CONTAINER_NAME="docker-machine-build-container"
DOCKER_BUILD_ARGS=${DOCKER_BUILD_ARGS:-""}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why default to empty string it's empty?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants