Local Docker Packaging
Use this skill to package a repository with Docker in a repeatable local workflow.
Start With Doctor Mode
Inspect the repo before building:
bash $CODEX_HOME/skills/local-docker-packaging/scripts/run_docker_packaging.sh \
--repo-root "$PWD" \
--doctor-only
Doctor mode reports:
- whether Docker daemon is reachable
- whether Colima is available for auto-recovery
- candidate build scripts
- candidate bundle scripts
- candidate Dockerfiles
- selected auto-detected inputs when unambiguous
Run The Standard Flow
If doctor mode shows a clean match, use the wrapper script directly:
bash $CODEX_HOME/skills/local-docker-packaging/scripts/run_docker_packaging.sh \
--repo-root "$PWD" \
--ensure-colima
Useful flags:
--build-script <path>: force a project-provided image build/export script.--bundle-script <path>: force a project-provided bundle script.--dockerfile <path>: force a Dockerfile when no build script is used.--context <path>: override the Docker build context for genericdocker build.--image-tag <tag>: override the image tag.--image-tar <path>: override the exported tar path.--bundle-dir <path>: pass an explicit output directory to the bundle script.--docker-build-flag <flag>: append raw flags to genericdocker build.--skip-image: skip image build/export.--skip-bundle: skip bundle assembly.
Follow The Selection Rules
- Prefer a project-provided build/export script when exactly one clear candidate exists.
- Fall back to generic
docker build -f ...plusdocker savewhen no build script exists and one Dockerfile can be selected safely. - Treat the bundle stage as optional: run it only when the repo exposes a clear bundle script or you pass one explicitly.
- When multiple scripts or Dockerfiles are detected, stop auto-execution and rerun with explicit paths instead of guessing.
Verify Before Declaring Success
Always verify:
docker infosucceeds or the wrapper can recover with Colima.- The exported image tar exists and is non-empty when image stage runs.
- The bundle directory and archive both exist when bundle stage runs.
- The chosen build context has a sensible
.dockerignorewhen the repo is large.
Load References On Demand
Read these files only when needed:
- Discovery rules and common repo shapes: references/repo-discovery.md
- Troubleshooting patterns: references/troubleshooting.md