Skip to content

Smart Restart

crib restart is faster than crib rebuild because it knows what changed. When you edit your devcontainer config, restart compares the current config against the stored one and picks the right strategy:

What changedWhat happensLifecycle hooks
NothingSimple container restart (docker restart)postStartCommand + postAttachCommand
Volumes, mounts, ports, env, runArgs, userContainer recreated with new configpostStartCommand + postAttachCommand
Image, Dockerfile, features, build argsError, suggests crib rebuild-

This follows the devcontainer spec’s Resume Flow: on restart, only postStartCommand and postAttachCommand run. Creation-time hooks (onCreateCommand, updateContentCommand, postCreateCommand) are skipped since they already ran when the container was first created.

The practical effect: you can tweak a volume mount or add an environment variable, run crib restart, and be back in your container in seconds instead of waiting for a full rebuild and all creation hooks to re-execute.

Terminal window
# Changed a volume in docker-compose.yml? Or added a mount in devcontainer.json?
crib restart # recreates the container, skips creation hooks
# Changed the base image or added a feature?
crib restart # tells you to run 'crib rebuild' instead