[PR #1739] [MERGED] fix: ensure networkmode "host" unless explicitly specified #2105

Closed
opened 2026-03-01 21:54:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/1739
Author: @ZauberNerd
Created: 4/18/2023
Status: Merged
Merged: 4/18/2023
Merged by: @mergify[bot]

Base: masterHead: default-networkmode-host


📝 Commits (2)

  • 893aa7b fix: ensure networkmode "host" unless explicitly specified
  • 2f7221b Merge branch 'master' into default-networkmode-host

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 pkg/container/docker_run.go (+6 -0)

📄 Description

act defaults network mode to "host", but when --container-options are passed on the CLI, it uses the docker CLI options parser, which fills empty values with defaults, in which case network mode is set to "default".
Unless the user explicitly sets --container-options="--network=xxx", we should always default to "host", to keep act's behaviour.


🔄 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/1739 **Author:** [@ZauberNerd](https://github.com/ZauberNerd) **Created:** 4/18/2023 **Status:** ✅ Merged **Merged:** 4/18/2023 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `default-networkmode-host` --- ### 📝 Commits (2) - [`893aa7b`](https://github.com/nektos/act/commit/893aa7bf6c0e666e282cf77edbfa5f7691d18573) fix: ensure networkmode "host" unless explicitly specified - [`2f7221b`](https://github.com/nektos/act/commit/2f7221b371a569ad9330cb80ef415589c4cb47b8) Merge branch 'master' into default-networkmode-host ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `pkg/container/docker_run.go` (+6 -0) </details> ### 📄 Description act defaults network mode to "host", but when `--container-options` are passed on the CLI, it uses the docker CLI options parser, which fills empty values with defaults, in which case network mode is set to "default". Unless the user explicitly sets `--container-options="--network=xxx"`, we should always default to "host", to keep act's behaviour. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:54:02 +03:00
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#2105
No description provided.