nektos/act · error

conflicting options: cannot specify both --ip6 and per-netwo

Error message

conflicting options: cannot specify both --ip6 and per-network IPv6 address

What it means

Error [96]: ContainerStart failed — the Docker daemon refused to start the created job container. The wrapped daemon error identifies the cause: conflicting port bindings, bad network, missing image entrypoint, OCI runtime errors (exec format wrong for host arch), or host config the daemon rejects at start time.

Source

Thrown at pkg/container/docker_cli.go:829

	if hasUserDefined && hasNonUserDefined {
		return nil, errors.New("conflicting options: cannot attach both user-defined and non-user-defined network-modes")
	}
	return endpoints, nil
}

func applyContainerOptions(n *opts.NetworkAttachmentOpts, copts *containerOptions) error { //nolint:gocyclo
	// TODO should we error if _any_ advanced option is used? (i.e. forbid to combine advanced notation with the "old" flags (`--network-alias`, `--link`, `--ip`, `--ip6`)?
	if len(n.Aliases) > 0 && copts.aliases.Len() > 0 {
		return errors.New("conflicting options: cannot specify both --network-alias and per-network alias")
	}
	if len(n.Links) > 0 && copts.links.Len() > 0 {
		return errors.New("conflicting options: cannot specify both --link and per-network links")
	}
	if n.IPv4Address.IsValid() && copts.ipv4Address != nil {
		return errors.New("conflicting options: cannot specify both --ip and per-network IPv4 address")
	}
	if n.IPv6Address.IsValid() && copts.ipv6Address != nil {
		return errors.New("conflicting options: cannot specify both --ip6 and per-network IPv6 address")
	}
	if n.MacAddress != "" && copts.macAddress != "" {
		return errors.New("conflicting options: cannot specify both --mac-address and per-network MAC address")
	}
	if len(n.LinkLocalIPs) > 0 && copts.linkLocalIPs.Len() > 0 {
		return errors.New("conflicting options: cannot specify both --link-local-ip and per-network link-local IP addresses")
	}
	if copts.aliases.Len() > 0 {
		n.Aliases = make([]string, copts.aliases.Len())
		copy(n.Aliases, copts.aliases.GetSlice())
	}
	// For a user-defined network, "--link" is an endpoint option, it creates an alias. But,
	// for the default bridge it defines a legacy-link.
	if container.NetworkMode(n.Target).IsUserDefined() && copts.links.Len() > 0 {
		n.Links = make([]string, copts.links.Len())
		copy(n.Links, copts.links.GetSlice())
	}
	if copts.ipv4Address != nil {

View on GitHub (pinned to 4f41128141)

Solutions

  1. Read the wrapped message verbatim — it is the daemon's diagnosis (port/network/OCI)
  2. Fix or remove conflicting options: create the network (docker network create foo) or drop the port binds
  3. For cross-arch: docker run --privileged --rm tonistiigi/binfmt --install all then re-run act If SELinux denies: adjust label options or host policy

Example fix

# before: missing network
act --container-options "--network=my-net"
# after
$ docker network create my-net && act --container-options "--network=my-net"
Defensive patterns

Strategy: validation

Validate before calling

// Pre-flight the options that break start
// network exists?
if _, err := cli.NetworkInspect(ctx, netName, client.NetworkInspectOptions{}); err != nil { log.Fatal("network missing") }
// host ports free?
for _, p := range usedHostPorts { if !portFree(p) { log.Fatalf("port %s in use", p) } }

Try / catch

if err != nil && strings.Contains(err.Error(), "failed to start container") {
	// wrapped daemon text after the colon is authoritative: port/network/OCI; fix that specific cause
}

Prevention

When it happens

Trigger: ContainerStart erroring: port already allocated (host port conflicts), network specified in options doesn't exist, image entrypoint missing executable, binary architecture mismatch without emulation (exec format error), SELinux/AppArmor denial.

Common situations: --container-options '--network=foo' where foo was deleted; two act jobs binding the same host port; running arm64 images on x86 without qemu binfmt; enterprise hardening (SELinux) blocking container start.

Related errors


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