← Back to Pull requests

honor containers.conf http_proxy and env settings during build #6996

Closed
unknown closed this pull request without merging on Sep 23, 2026 08:48 UTC
View on GitHub
unknown unknown commented on Jul 26, 2026 19:24 UTC
Author

What type of PR is this?

/kind bug

What this PR does / why we need it

This PR resolves an issue where podman build ignored containers.conf settings (http_proxy = false and [containers] env). Please also see the linked issue for more context.

1. Binds the --http-proxy CLI flag default in pkg/cli/common.go to Containers.HTTPProxy from containers.conf instead of hardcoding true. This makes build proxy flag defaults consistent with podman run, allowing http_proxy = false in containers.conf to disable host environment proxy passthrough by default.
2. Updates configureEnvironment() in run_common.go to inject environment variables defined under [containers] env in containers.conf into the transient container process spec (g.AddProcessEnv) during RUN steps. This fixes the regression from pre-6.0.x where containers.conf environment settings applied to build execution commands (e.g. package management and network requests).

How to verify it

1. Configure containers.conf:

   [containers]
   http_proxy = false
   env = [
     "http_proxy=http://host.containers.internal:1080",
   ]
   

2. Export host shell environment variables:

   export http_proxy=http://127.0.0.1:1080
   

3. Run build:

   podman build --no-cache -f - . << 'EOF'
   FROM alpine
   RUN env | grep -i proxy
   EOF
   

4. Verify output contains http_proxy=http://host.containers.internal:1080 instead of http://127.0.0.1:1080.

Which issue(s) this PR fixes

Fixes: https://github.com/podman-container-tools/podman/issues/29299

Special notes for your reviewer

g.AddProcessEnv in configureEnvironment() sets the process spec environment (g.Config.Process.Env) for transient container execution during RUN steps. It does not touch builder.OCIv1.Config.Env, ensuring that environment variables configured in containers.conf apply to build execution without polluting committed image layers.

Does this PR introduce a user-facing change?

Not sure if a release note is needed for regressions, but this does contain user-facing change:

``release-note
Honor
containers.conf http_proxy and env settings during image builds, aligning the behavior with podman run and fixed regression introduced in 6.0.x.
``

Diff: 297 lines (+222 / -75) across 3 files Reviewer: simonbrauner Review duration: 84324m
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 297 lines diff across 3 files
0.40
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.341
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #6996"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 40% (MEDIUM) · Higher = larger blast radius
40%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.8% · Safe to merge
15.8%