Skip to content

Instantly share code, notes, and snippets.

@benschw
Created December 18, 2013 04:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benschw/8017402 to your computer and use it in GitHub Desktop.
Save benschw/8017402 to your computer and use it in GitHub Desktop.
remove Ghosted docker containers

to remove a container that docker doesn't know isn't running:

  • take note of the container ID
  • service stop docker
  • modify the config.json file in /var/lib/docker/containers/$CONTAINER_ID to have "Running":false
  • service start docker
  • docker rm $CONTAINER_ID

Unfortunately, this makes all the other containers turn into ghosts, so you can only do it when there's only a single container. Plus it's really hacky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment