Skip to content

Critical Issue: make clean executes docker system prune --volumes, leading to unintended data loss #1663

@maltzsama

Description

@maltzsama

Description:

The current implementation of the clean target in the project's Makefile is extremely dangerous. Specifically, the clean_docker target runs docker system prune --volumes.

This command does not just clean Querybook-related resources; it wipes all unused Docker objects on the host machine, including:

  • Volumes from other projects (e.g., Minikube, local dev databases).
  • Shared networks.
  • Build caches for unrelated containers.

In a professional development environment where multiple projects coexist, this behavior is unacceptable and leads to significant data loss and downtime.

Steps to Reproduce:

  1. Have other Docker projects or a Minikube cluster running (or stopped) with persistent volumes.
  2. Run make clean in the Querybook repository.
  3. Observe that all volumes and resources from other projects are permanently deleted.

Suggested Fix:

The clean target should be scoped strictly to Querybook resources. Instead of a global prune, it should target specific containers, images, and volumes using filters or the project name defined in the docker-compose.yml.

Example of a safer approach:

clean_docker:
	docker-compose down -v --rmi local

This ensures only the current project's resources are removed.


Additional Context:

I personally lost a configured Minikube cluster and several other development volumes due to this command. A "clean" command in a repository should never affect the global Docker state of the host.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions