nektos/act · error

Cannot merge container.HostConfig options

Error message

Cannot merge container.HostConfig options: '%s': '%w'

What it means

Error "Cannot merge container.HostConfig options: '%s': '%w'" thrown in nektos/act.

Solutions

  1. Check the wrapped error for the underlying HostConfig field that failed to merge (e.g. Binds, PortBindings, NetworkMode).
  2. Ensure container options passed via --container-options are valid Docker HostConfig values.
  3. Simplify or remove conflicting container options and retry.

When it happens

Trigger: Thrown at pkg/container/docker_run.go:403 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of nektos/act@4f41128141 (2026-08-15). Data as JSON: /api/errors/a7abbe56a21c8dcd. Report an issue: GitHub.

Appendix: source

Thrown at pkg/container/docker_run.go:403

hostConfig.Binds = append(hostConfig.Binds, containerConfig.HostConfig.Binds...)
hostConfig.Mounts = append(hostConfig.Mounts, containerConfig.HostConfig.Mounts...)
binds := hostConfig.Binds
mounts := hostConfig.Mounts
err = mergo.Merge(hostConfig, containerConfig.HostConfig, mergo.WithOverride)
if err != nil {
	return nil, nil, fmt.Errorf("Cannot merge container.HostConfig options: '%s': '%w'", input.Options, err)
}
hostConfig.Binds = binds
hostConfig.Mounts = mounts

View on GitHub (pinned to 4f41128141)