Add --userns flag to support Docker daemon that enables user namespace (#533)
I got an error like this after hitting `act` command. > Error: Error response from daemon: cannot share the host's network namespace when user namespaces are enabled According to the document, when user namespaces are enabled on the Docker daemon, neither host network mode and --privileged work without --userns=host. Since `act` uses host network mode to match GitHub Actions runners, it cannot run jobs when user namespaces are enabled. So I added the flag. https://docs.docker.com/engine/security/userns-remap/#user-namespace-known-limitations Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
@@ -106,6 +106,7 @@ func (rc *RunContext) startJobContainer() common.Executor {
|
||||
Stdout: logWriter,
|
||||
Stderr: logWriter,
|
||||
Privileged: rc.Config.Privileged,
|
||||
UsernsMode: rc.Config.UsernsMode,
|
||||
})
|
||||
|
||||
var copyWorkspace bool
|
||||
|
@@ -31,6 +31,7 @@ type Config struct {
|
||||
InsecureSecrets bool // switch hiding output when printing to terminal
|
||||
Platforms map[string]string // list of platforms
|
||||
Privileged bool // use privileged mode
|
||||
UsernsMode string // user namespace to use
|
||||
}
|
||||
|
||||
type runnerImpl struct {
|
||||
|
@@ -234,6 +234,7 @@ func (sc *StepContext) newStepContainer(ctx context.Context, image string, cmd [
|
||||
Stdout: logWriter,
|
||||
Stderr: logWriter,
|
||||
Privileged: rc.Config.Privileged,
|
||||
UsernsMode: rc.Config.UsernsMode,
|
||||
})
|
||||
return stepContainer
|
||||
}
|
||||
|
Reference in New Issue
Block a user