VOLUME: Declares a mount point whose data should live in a volume, outside the container's writable layer. VOLUME in a Dockerfile marks a folder whose data should live outside the container's own file system, such as VOLUME ["/var/lib/mysql"]. When a container starts, Docker mounts a volume there. If you do not provide a named volume yourself, Docker creates an anonymous one with a random name. That is how data can seem to disappear: a new container gets a new anonymous volume, while the old data sits in another one.
Many official database images declare volumes for their data folders. In your own images, use VOLUME sparingly, because later Dockerfile steps cannot change files in a declared volume. Prefer declaring volumes at runtime, in docker run -v or the Compose file, with clear names, so it is obvious where data lives and how to back it up.
Use this skill when creating, modifying, or debugging Docker Compose configurations, even if the user just says they need to wire services together, add a database to their stack, or set up a local development environment with multiple containers. Covers service definitions, health checks, dependency ordering, volumes, networks, environment variables, and development overrides.
Use this skill before running, or recommending, any Docker command that deletes, wipes, resets, or otherwise irreversibly changes state — even if the user just says to "clean up", "clear the cache", "start fresh", "wipe everything", "nuke it", "reset", "force remove", or "tear down" Docker resources. Covers generic Docker CLI destructive operations not owned by a more specific skill — `docker rm`,
Use this skill when setting up, initializing, or Dockerizing a project, even if the user doesn't explicitly mention Docker but describes a need for containerized local development, adding a database or cache dependency, or running services without host-level installs. Covers Dockerfile, compose.yaml, and .dockerignore creation with Docker best practices.