nektos/act · critical

no name set for network

Error message

no name set for network

What it means

Error [99]: act's docker socket resolution found neither a usable DOCKER_HOST env var, a docker context, nor a valid socket in the usual locations (/var/run/docker.sock etc.), and the configured socket value is not a URI. Act refuses to proceed because there is no daemon endpoint to talk to and no explicit '-' (don't-mount) opt-out. This fails before any container work starts.

Source

Thrown at pkg/container/docker_cli.go:868

		}
	}
	if copts.ipv6Address != nil {
		if ipv6, ok := netip.AddrFromSlice(copts.ipv6Address.To16()); ok {
			n.IPv6Address = ipv6
		}
	}
	if copts.macAddress != "" {
		n.MacAddress = copts.macAddress
	}
	if copts.linkLocalIPs.Len() > 0 {
		n.LinkLocalIPs = toNetipAddrSlice(copts.linkLocalIPs.GetSlice())
	}
	return nil
}

func parseNetworkAttachmentOpt(ep opts.NetworkAttachmentOpts) (*network.EndpointSettings, error) {
	if strings.TrimSpace(ep.Target) == "" {
		return nil, errors.New("no name set for network")
	}
	if !container.NetworkMode(ep.Target).IsUserDefined() {
		if len(ep.Aliases) > 0 {
			return nil, errors.New("network-scoped aliases are only supported for user-defined networks")
		}
		if len(ep.Links) > 0 {
			return nil, errors.New("links are only supported for user-defined networks")
		}
	}

	epConfig := &network.EndpointSettings{
		GwPriority: ep.GwPriority,
	}
	epConfig.Aliases = append(epConfig.Aliases, ep.Aliases...)
	if len(ep.DriverOpts) > 0 {
		epConfig.DriverOpts = make(map[string]string)
		epConfig.DriverOpts = ep.DriverOpts
	}

View on GitHub (pinned to 4f41128141)

Solutions

  1. Install/start Docker: systemctl start docker (or open Docker Desktop, or 'colima start')
  2. Point DOCKER_HOST at the real socket: export DOCKER_HOST=unix:///run/user/1000/docker.sock (rootless) or the colima socket
  3. If running act in a container: mount -v /var/run/docker.sock:/var/run/docker.sock
  4. If you deliberately don't want the socket mounted, pass '-' as the socket value so act skips mounting instead of erroring

Example fix

# before: rootless docker socket unknown to act
export PATH=$HOME/.docker/run:$PATH  # act still fails
# after
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock
act -j build
Defensive patterns

Strategy: validation

Validate before calling

// Verify a docker endpoint exists before launching act
import (
	"os"
	"os/exec"
)

func dockerAvailable() bool {
	if os.Getenv("DOCKER_HOST") != "" {
		return true
	}
	if _, err := os.Stat("/var/run/docker.sock"); err == nil {
		return true
	}
	return exec.Command("docker", "context", "show").Run() == nil
}

Type guard

func isDockerHostURI(v string) bool {
	return strings.HasPrefix(v, "unix://") || strings.HasPrefix(v, "tcp://") || strings.HasPrefix(v, "npipe://")
}

Try / catch

if err != nil && strings.Contains(err.Error(), "DOCKER_HOST was not set") {
	// guide user: start docker, or export DOCKER_HOST, or pass '-' to skip socket mount
}

Prevention

When it happens

Trigger: getSocketAndHost early-exit: DOCKER_HOST unset, docker context points nowhere, default socket path doesn't exist or isn't a socket, and the derived Socket value is a bare path (not unix:// or tcp://). Typical on hosts without Docker installed, WSL without Docker Desktop, rootless docker with XDG_RUNTIME_DIR unset, or containers/CI where /var/run/docker.sock isn't mounted.

Common situations: Fresh machine without Docker; running act inside a container without mounting the docker socket; rootless Docker where the socket is at $XDG_RUNTIME_DIR/docker.sock and the env is missing; WSL distro without Docker Desktop integration; colima not started.

Related errors


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