skaffold dev: Usage & Common CI Errors
Continuous build-and-deploy with file watching for inner-loop development.
skaffold dev runs the build/deploy pipeline and then watches your source, rebuilding and redeploying on every change. It is the developer inner loop - and a long-running process you should not run bare in CI.
What it does
skaffold dev does an initial build and deploy, then watches files and the cluster: on a source change it rebuilds, re-pushes, and redeploys, streaming logs. On exit (Ctrl-C) it cleans up the deployed resources by default. It is interactive and continuous, not one-shot.
Common usage
# Start the dev watch loop
skaffold dev
# Stream container logs as part of the loop
skaffold dev --tail
# Keep deployed resources on exit instead of cleaning up
skaffold dev --cleanup=falseCommon error in CI: dev never exits / cleans up on exit
In CI, skaffold dev blocks forever (it watches), and when the job is killed it tears down what it deployed - so nothing remains. Fix: use skaffold run for one-shot build+deploy in CI, not dev. If you need logs from a one-shot deploy, add --tail to skaffold run. Reserve skaffold dev for local development where the watch loop and auto-cleanup are the point.
Key options
| Option | Purpose |
|---|---|
| --tail | Stream logs from deployed containers |
| --cleanup=false | Do not delete resources on exit |
| --profile NAME | Activate a profile |
| --default-repo REPO | Override the registry prefix |