[PR #2723] feat: Enable passing of proxy variables to Docker build #2575

Open
opened 2026-03-01 22:37:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/2723
Author: @john-tipper
Created: 4/5/2025
Status: 🔄 Open

Base: masterHead: #2722-docker-build-proxy-vars


📝 Commits (7)

  • 8e04748 Enable passing of proxy variables to Docker build
  • 6b8ca1a Pass params from command line
  • 6e864e1 Update docker_build.go
  • 985066d Amend lint & fmt checks
  • 6d6e8c5 Add tests
  • 3e54973 Allow passing custom variables to docker build process by key
  • 71674f6 Merge branch 'master' into #2722-docker-build-proxy-vars

📊 Changes

8 files changed (+191 additions, -2 deletions)

View changed files

📝 cmd/input.go (+1 -0)
📝 cmd/root.go (+8 -0)
📝 pkg/container/container_types.go (+1 -0)
📝 pkg/container/docker_build.go (+26 -2)
pkg/container/docker_build_test.go (+41 -0)
📝 pkg/runner/action.go (+19 -0)
📝 pkg/runner/action_test.go (+94 -0)
📝 pkg/runner/runner.go (+1 -0)

📄 Description

Resolves #2722.

This PR adds a flag called --pass-proxy-vars-to-docker-build --pass-envvars-to-docker-build which allows the user to pass proxy variables through to the build of Docker-based actions. These variables are HTTP_PROXY, HTTPS_PROXY and NO_PROXY, plus the lowercase versions too because not all applications respect all cases.

The variables that are set are taken from the environment of Act itself. If the URL includes a password then this is redacted when logging the command passed to Docker.

This PR allows Act to be used within an enterprise environment where access to the internet is via an authenticating proxy, otherwise Docker-based actions are not able to be used if they need to access the internet as part of their build process.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/2723 **Author:** [@john-tipper](https://github.com/john-tipper) **Created:** 4/5/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `#2722-docker-build-proxy-vars` --- ### 📝 Commits (7) - [`8e04748`](https://github.com/nektos/act/commit/8e0474885f21fb8415eea8ca2976aa953ae5833a) Enable passing of proxy variables to Docker build - [`6b8ca1a`](https://github.com/nektos/act/commit/6b8ca1a2b85743ce37096aee0bf5444b5bccc5b4) Pass params from command line - [`6e864e1`](https://github.com/nektos/act/commit/6e864e177db4eb4ca99fe40092aa58bf97f40fd4) Update docker_build.go - [`985066d`](https://github.com/nektos/act/commit/985066d3150c369e3bf4cd697fabf9f29ad53f23) Amend lint & fmt checks - [`6d6e8c5`](https://github.com/nektos/act/commit/6d6e8c54ff337270d88bdf56407705eba6a85a9c) Add tests - [`3e54973`](https://github.com/nektos/act/commit/3e5497381892f67e12ec077f353e7efb2fcac17c) Allow passing custom variables to docker build process by key - [`71674f6`](https://github.com/nektos/act/commit/71674f65606cb6fe21e65c4e52528f8af19971ba) Merge branch 'master' into #2722-docker-build-proxy-vars ### 📊 Changes **8 files changed** (+191 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `cmd/input.go` (+1 -0) 📝 `cmd/root.go` (+8 -0) 📝 `pkg/container/container_types.go` (+1 -0) 📝 `pkg/container/docker_build.go` (+26 -2) ➕ `pkg/container/docker_build_test.go` (+41 -0) 📝 `pkg/runner/action.go` (+19 -0) 📝 `pkg/runner/action_test.go` (+94 -0) 📝 `pkg/runner/runner.go` (+1 -0) </details> ### 📄 Description Resolves #2722. This PR adds a flag called ~~`--pass-proxy-vars-to-docker-build`~~ `--pass-envvars-to-docker-build` which allows the user to pass proxy variables through to the build of Docker-based actions. These variables are HTTP_PROXY, HTTPS_PROXY and NO_PROXY, plus the lowercase versions too because not all applications respect all cases. The variables that are set are taken from the environment of Act itself. If the URL includes a password then this is redacted when logging the command passed to Docker. This PR allows Act to be used within an enterprise environment where access to the internet is via an authenticating proxy, otherwise Docker-based actions are not able to be used if they need to access the internet as part of their build process. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#2575
No description provided.