docker-dev-rebuild-after-migration

Rebuilds Docker dev images and refreshes stale volumes after Dockerfile or dependency changes.

1|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/VilnaCRM-Org/claude-plugins --skill docker-dev-rebuild-after-migration-vilnacrm-org
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: docker-dev-rebuild-after-migration
Source: https://github.com/VilnaCRM-Org/claude-plugins/tree/main/plugins/react-frontend-sdlc/skills/docker-dev-rebuild-after-migration
Command: npx skills add https://github.com/VilnaCRM-Org/claude-plugins --skill docker-dev-rebuild-after-migration-vilnacrm-org

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? After changing a Dockerfile, base image, Node version, or package manager, the dev container often keeps running stale code: tools go missing (exit 127), the dev server throws "Cannot find module" or HTTP 500 for correct code, and dependencies resolve to versions the lockfile no longer pins. This Skill diagnoses and fixes that stale-container state. ## Core Features & Use Cases - Ordered rebuild procedure: Rebuilds the image with docker compose build dev, refreshes named or anonymous node_modules volumes, clears bundler build caches, then restarts and verifies the dev service. - Repository-shape awareness: Adapts the procedure for React SPA, Next.js, and component-library shapes based on profile keys like make.start, make.build, framework.bundler, and framework.package_manager. - Root-owned artifact recovery: Explains how to stop the container and remove root-owned build-artifact directories that a host user cannot delete. - Use Case: After bumping the Node version in the Dockerfile, the dev server returns HTTP 500 despite correct code on disk — follow the procedure to rebuild the image, recreate the module volume, clear the bundler cache, and verify with docker compose ps and a curl health check. ## Quick Start Ask the assistant to rebuild the dev container and refresh stale volumes because the dev server is serving old code after a Dockerfile change.

Frequently Asked Questions about docker-dev-rebuild-after-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I rebuild a Docker dev container after changing the Dockerfile?▼

Run docker compose build dev explicitly rather than relying on your start target, since some make start recipes use cached images. Then refresh the module volume, clear bundler build caches, and restart the stack before verifying the service is healthy.

Why does my dev server say Cannot find module after a dependency update?▼

Docker seeds a volume only when it is created, so an existing node_modules volume keeps the old dependency tree even after the image is rebuilt. Recreate the anonymous volume with docker compose up -d --renew-anon-volumes or remove the named volume while the container is stopped.

Does docker compose up rebuild the image automatically?▼

No, a plain up -d starts containers against the cached image. Only targets that pass --build trigger a rebuild, so check your make start recipe and run docker compose build dev explicitly when it does not.

Why can't I delete a build directory created by Docker?▼

The dev container runs as root while the worktree is bind-mounted, so files it writes are root-owned on the host and a user-shell delete fails. Stop the container first to release the directory, then remove it with elevated privileges.

When should I not use this rebuild procedure?▼

Skip it for application bugs reproducible on a freshly built image and for CI failures, since CI runners build from scratch and share no cache with a local checkout. It also does not apply to component-library shapes where start already rebuilds and nothing is mounted.