From ac5919269646d9f19db1bbf8453d60a04fc35740 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Fri, 8 Sep 2017 14:18:12 +0300 Subject: [PATCH] Do not leave containers behind after matrix-postgres-cli usage --- .../templates/usr-local-bin/matrix-postgres-cli.j2 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/roles/matrix-server/templates/usr-local-bin/matrix-postgres-cli.j2 b/roles/matrix-server/templates/usr-local-bin/matrix-postgres-cli.j2 index 083c5df28..383a78fcd 100644 --- a/roles/matrix-server/templates/usr-local-bin/matrix-postgres-cli.j2 +++ b/roles/matrix-server/templates/usr-local-bin/matrix-postgres-cli.j2 @@ -1,3 +1,9 @@ #!/bin/bash -docker run --env-file={{ matrix_environment_variables_data_path }}/env-postgres-pgsql-docker -it --link=matrix-postgres:postgres postgres:9.6.3-alpine psql -h postgres \ No newline at end of file +docker run \ + -it \ + --rm \ + --env-file={{ matrix_environment_variables_data_path }}/env-postgres-pgsql-docker \ + --link=matrix-postgres:postgres \ + {{ docker_postgres_image }} \ + psql -h postgres