marmelab/docker-composer-hhvm — pull request #2 by jeremy-derusse (2014-09-12 21:00:05+00:00)
Title: Use argument --rm

Each time you run `docker rm` a new container is created
```bash
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$ docker run -ti -v `pwd`:/srv marmelab/composer-hhvm bash -c 'hhvm /usr/local/bin/composer --version'
Composer version a8adbfeb9fc7861deade782938222714168a22a8 2014-09-05 16:28:50
$ docker run -ti -v `pwd`:/srv marmelab/composer-hhvm bash -c 'hhvm /usr/local/bin/composer --version'
Composer version a8adbfeb9fc7861deade782938222714168a22a8 2014-09-05 16:28:50
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
404daa4bc9d1 marmelab/composer-hhvm:latest bash -c 'hhvm /usr/l 4 seconds ago Exited (0) 2 seconds ago hungry_euclid
04e9a1345095 marmelab/composer-hhvm:latest bash -c 'hhvm /usr/l 7 seconds ago Exited (0) 5 seconds ago hungry_carson
```

On "one shot" container like this one, adding the argument `--rm` delete this temporary container

```bash
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$ docker run -ti --rm -v `pwd`:/srv marmelab/composer-hhvm bash -c 'hhvm /usr/local/bin/composer --version'
Composer version a8adbfeb9fc7861deade782938222714168a22a8 2014-09-05 16:28:50
$ docker run -ti --rm -v `pwd`:/srv marmelab/composer-hhvm bash -c 'hhvm /usr/local/bin/composer --version'
Composer version a8adbfeb9fc7861deade782938222714168a22a8 2014-09-05 16:28:50
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
```

see http://docs.docker.com/reference/run/#clean-up-rm