Skip to content

fix(dogfood/coder): stop docker containers and prune system on shutdown #17904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 19, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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
```
  • Loading branch information
mafredri committed May 19, 2025
commit d6fc65a6656bbfdc526bc448785e552cd7f068b1
4 changes: 4 additions & 0 deletions dogfood/coder/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ resource "coder_agent" "dev" {
#!/usr/bin/env bash
set -eux -o pipefail

# Stop all running containers and prune the system to clean up /var/lib/docker.
docker ps -q | xargs docker stop
docker system prune -a

# Stop the Docker service to prevent errors during workspace destroy.
sudo service docker stop
EOT
Expand Down