anthropics / anthropics/claude-quickstarts

(MacOS) Ports are not available: 5900

Ouverte
#147 4 commentaires 3 réactions 0 personnes assignées Voir sur GitHub
bug computer use docker
Langage dominant
TypeScript
Étoiles
17.6k
Forks
3k
Merge moyen
5 h 13 min
PR mergées (30 j)
3

Description

Executing the (minimally tweaked) `docker run` command from the README.md:

```bash
docker run -d \
-e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
-v "$(pwd)":/host \
-p 5900:5900 \
-p 8501:8501 \
-p 6080:6080 \
-p 8080:8080 \
--name "$CONTAINER_NAME" \
-it "$IMAGE_NAME"

28e..43e
docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:5900 -> 0.0.0.0:0: listen tcp 0.0.0.0:5900: bind: address already in use.
```

Inspecting, ...
```bash
> lsof -i :5900
Password:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
launchd 1 root 11u IPv6 0xc679adcb0b88da06 0t0 TCP *:rfb (LISTEN)
launchd 1 root 12u IPv4 0xdaeb2706f944b831 0t0 TCP *:rfb (LISTEN)
launchd 1 root 14u IPv6 0xc679adcb0b88da06 0t0 TCP *:rfb (LISTEN)
launchd 1 root 15u IPv4 0xdaeb2706f944b831 0t0 TCP *:rfb (LISTEN)
```

It turns out that I have to disable screen-sharing on macOS to free this port:

Screenshot 2024-11-01 at 20 42 30

I think it's a mistake to re-use a port that macOS has, by default, reserved, given that you are free to use ANY port you wish.

It does seem odd to me that in 2024 the best solution still seems to be "Pick a random 16-bit integer and hope nobody else on your OS picked the same one". Very retro. hey ho...

I think it would make much more sense to have a .ports file and make the ports dynamic. And to use different numbers for external and internal. That would make the code easier to work with.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.