No such container 🐳 Docker

Error response from daemon: No such container

The container name or ID you used doesn’t exist on this Docker host — it was removed, has another name, or you’re talking to a different daemon/context.

Seen on: Docker

Meaning

Containers created with --rm disappear when they stop, Compose names containers project-service-1, and docker context can point the CLI at another machine.

Common causes

  • Container already removed (--rm, prune)
  • Wrong name (Compose adds project prefix and -1 suffix)
  • Different docker context / remote daemon
  • Truncated or mistyped ID

⚡ Quick fix

  1. List all containers: docker ps -a
  2. Use docker compose exec <service> instead of container names
  3. Check docker context ls

Detailed fix by platform

Docker

  1. bash
    docker ps -a --format '{{.ID}}  {{.Names}}  {{.Status}}'
    docker compose exec web sh

How to diagnose

  1. Exists — docker ps -a | grep name
  2. Context — docker context show

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.