Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: enabled build behind proxy #7842

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dtrawins
Copy link

What does the PR do?

Adds support to build behind proxy by mount docker/config.json into the container running the build.

Checklist

  • I have read the Contribution guidelines and signed the Contributor License
    Agreement
  • PR title reflects the change and is of format <commit_type>: <Title>
  • Changes are described in the pull request.
  • Related issues are referenced.
  • Populated github labels field
  • Added test plan and verified test passes.
  • Verified that the PR passes existing CI.
  • I ran pre-commit locally (pre-commit install, pre-commit run --all)
  • Verified copyright is correct on all changed files.
  • Added succinct git squash message before merging ref.
  • All template sections are filled out.
  • Optional: Additional screenshots for behavior/output changes with before/after.

Commit Type:

Check the conventional commit type
box here and add the label to the github PR.

  • build
  • ci
  • docs
  • feat
  • fix
  • perf
  • refactor
  • revert
  • style
  • test

Related PRs:

Where should the reviewer start?

Test plan:

run build.py with .docker/config.json - confirm successful build behind proxy
run build.py without .docker/config.json - confirm build fails with apt install error

Caveats:

Background

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • closes GitHub issue: #xxx

Comment on lines +1775 to +1776
if os.path.exists(os.path.expanduser("~/.docker/config.json")):
runargs += ["-v", os.path.expanduser("~/.docker/config.json:/root/.docker/config.json")]
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really like this change.
It's kind of we allow to add something without validation.
We have no control of ~/.docker/config.json entries there why we may be forced to review some false positive issues related to user environment.

I may need a bit more context, sound like user looking for a proxy config during the build process, and I may be mistaken here but the issue happen when we run Docker-out-of-Docker configuration using build.py and user is behind the proxy.

I suppose it's better to add a flag for users --use-user-docker-config and add value accordingly if flag is given.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree a flag may be more appropriate here to be clear on the intent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants