Skip to content

Commit d6fc65a

Browse files
committed
fix(dogfood/coder): run docker system prune on shutdown
Hopefully the final update to thne fix in #17110 This change greatly speeds up workspace destruction: ``` 2025-05-19 12:26:57.046+03:00 docker_container.workspace[0]: Destroying... [id=2685e2f456ba7b280c420219f19ef15384faa52c61ba7c087c7f109ffa6b1bda] 2025-05-19 12:27:07.046+03:00 docker_container.workspace[0]: Still destroying... [10s elapsed] 2025-05-19 12:27:16.734+03:00 docker_container.workspace[0]: Destruction complete after 20s ```
1 parent 1a41608 commit d6fc65a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dogfood/coder/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,10 @@ resource "coder_agent" "dev" {
373373
#!/usr/bin/env bash
374374
set -eux -o pipefail
375375
376+
# Stop all running containers and prune the system to clean up /var/lib/docker.
377+
docker ps -q | xargs docker stop
378+
docker system prune -a
379+
376380
# Stop the Docker service to prevent errors during workspace destroy.
377381
sudo service docker stop
378382
EOT

0 commit comments

Comments
 (0)