TL;DR: The host port is taken. Identify the holder with `docker ps` and `ss -tlnp`, then either stop it or publish a different host port. This message is the newer daemon wording for the classic port conflict; the fix is identical to the older 'port is already allocated' error.

## The error

```text
Ports are not available: exposing port TCP the all-interfaces address:8080 -> the all-interfaces address:0: listen tcp4 the all-interfaces address:8080: bind: address already in use
```

## Fix it

1. Check running containers first:
   `docker ps --filter "publish=8080"`
   Expected: the conflicting container, if any.
2. Then host processes:
   `sudo ss -tlnp | grep ':8080'`
   Expected: process and PID.
3. Resolve by stopping the holder or remapping:
   `docker run -p 8081:8080 [image]`
   Expected: starts cleanly.

## When this applies
- `docker run -p` failing with "Ports are not available"
- Docker Desktop and Engine 24+ which use this wording

## When this does NOT apply
- Container app failing to bind its OWN port (that is inside the container; check the app config)
- "port is already allocated" (older wording, same fix)

## Versions
Docker Engine 23+, Docker Desktop 4.20+.

## Why it happens
The daemon pre-validates port availability before creating the container's network endpoint. Anything in the host network namespace already bound to that port, including a previous instance of the same container, trips the check.

## Edge cases
- Docker Desktop on Mac/Windows: the "host" here is the Linux VM; a process inside the VM (rare) or the port-forwarding layer can be the holder.
- Ephemeral port exhaustion on busy hosts can produce this for high port numbers; check `cat /proc/sys/net/ipv4/ip_local_port_range`.
- Restart policies can recreate the conflict automatically; `docker update --restart=no` the old container before remapping.
