## Troubleshooting

If you open a new terminal, you need the Docker environment variables again. You can set them up in
the current shell by running (assuming the name `default` for the Docker machine)

```sh
eval "$(docker-machine env default)"
```

If the Docker machine becomes unresponsive with status `UNKNOWN` when running `docker-machine ls` try rebuilding it

```sh
$ docker-machine rm -y default && docker-machine create -d virtualbox default && eval $(docker-machine env)
```

To delete all running containers and images (use `-f` option to force)

```sh
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all unused images
docker rmi $(docker images --filter dangling=true)
# Delete all images
docker rmi $(docker images -q)
```

To stop all running containers

```sh
IDS=$(docker ps -q)
docker stop $IDS
# or as a single command
docker stop $(docker ps -q)
```

If you have a container "demo" and would like to investigate it, start it in the interactive mode with a "bash" as entry

```sh
docker run -it --entrypoint bash demo
```