From f490bd1752ceab0778acbcdc41d5215dea221a2e Mon Sep 17 00:00:00 2001 From: Oren Date: Wed, 20 Jun 2018 00:58:30 +0300 Subject: [PATCH] Update docker-compose run --rm doc (#6803) * Update docker-compose run --rm doc To make the functionality added in https://github.com/funkyfuture/docker-compose/commit/24ab933ebfd3169491beeb18f0041cabebe4d2d2 explicit in the docs * Rewrite change as an addendum Rewrite the change to the end of the page as an addendum to the description of the inner workings of the run command. --- compose/reference/run.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compose/reference/run.md b/compose/reference/run.md index c916aca330..ac9fe71ba0 100644 --- a/compose/reference/run.md +++ b/compose/reference/run.md @@ -56,3 +56,9 @@ This opens an interactive PostgreSQL shell for the linked `db` container. If you do not want the `run` command to start linked containers, use the `--no-deps` flag: docker-compose run --no-deps web python manage.py shell + +If you want to remove the container after running while overriding the container's restart policy, use the `--rm` flag: + + docker-compose run --rm web python manage.py db upgrade + +This runs a database upgrade script, and removes the container when finished running, even if a restart policy is specified in the service configuration.