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
Prev Previous commit
Next Next commit
update comment
  • Loading branch information
mafredri committed May 19, 2025
commit 8bc327727b489ec4e1ad3dcff2bb3906e22d2574
9 changes: 8 additions & 1 deletion dogfood/coder/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,14 @@ 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.
# Stop all running containers and prune the system to clean up
# /var/lib/docker to prevent errors during workspace destroy.
#
# WARNING! This will remove:
# - all containers
# - all networks not used by at least one container
# - all images without at least one container associated to them
# - all build cache
docker ps -q | xargs docker stop
docker system prune -a

Expand Down
Loading