From 1a9cafa3a33387f2c32eb736e6a4665dd87a177e Mon Sep 17 00:00:00 2001 From: Fanch Date: Sat, 10 Oct 2020 04:11:26 +0200 Subject: [PATCH 1/2] add run-docker-prune command --- roles/matrix-common-after/tasks/main.yml | 4 ++++ roles/matrix-common-after/tasks/run_docker_prune.yml | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 roles/matrix-common-after/tasks/run_docker_prune.yml diff --git a/roles/matrix-common-after/tasks/main.yml b/roles/matrix-common-after/tasks/main.yml index 197ab6a9..d77d56a1 100644 --- a/roles/matrix-common-after/tasks/main.yml +++ b/roles/matrix-common-after/tasks/main.yml @@ -11,3 +11,7 @@ - import_tasks: "{{ role_path }}/tasks/dump_runtime_results.yml" tags: - always + +- import_tasks: "{{ role_path }}/tasks/run_docker_prune.yml" + tags: + - run-docker-prune diff --git a/roles/matrix-common-after/tasks/run_docker_prune.yml b/roles/matrix-common-after/tasks/run_docker_prune.yml new file mode 100644 index 00000000..a7e35a03 --- /dev/null +++ b/roles/matrix-common-after/tasks/run_docker_prune.yml @@ -0,0 +1,4 @@ +--- + +- name: Run Docker System Prune + command: "{{ matrix_host_command_docker }} system prune -a -f" From 4d5068e283e9bab4dfedfd51e1357a6775126960 Mon Sep 17 00:00:00 2001 From: Fanch Date: Sat, 10 Oct 2020 14:27:07 +0200 Subject: [PATCH 2/2] add some doc about the run-docker-prune tag --- docs/maintenance-and-troubleshooting.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/maintenance-and-troubleshooting.md b/docs/maintenance-and-troubleshooting.md index bccf3e2e..ae90fba2 100644 --- a/docs/maintenance-and-troubleshooting.md +++ b/docs/maintenance-and-troubleshooting.md @@ -33,6 +33,12 @@ matrix_synapse_root_log_level: "INFO" Re-run the playbook after making these configuration changes. +## Remove unused Docker data + +You can free some disk space from Docker, see [docker system prune](https://docs.docker.com/engine/reference/commandline/system_prune/) for more information. +```bash +ansible-playbook -i inventory/hosts setup.yml --tags=run-docker-prune +``` ## Postgres