- /docker-smoke-test: prep, build, verify all Dockerfiles in a repo - /audit-repo-health: cross-repo pnpm/Docker/config consistency audit - /verify-all-backends: quick local typecheck+test+build (complement to /gitea-ci)
2.1 KiB
2.1 KiB
| description |
|---|
| Docker smoke test — prep, build, and verify all Dockerfiles in the current repo |
Docker Smoke Test
Build and verify all Dockerfiles in the current product repo. Runs docker-prep, builds each image, then restores package.json files.
Prerequisite: Docker Desktop must be running. The current repo must have scripts/docker-prep.sh.
1. Identify the repo and its Dockerfiles
// turbo
REPO_DIR="$(pwd)"
REPO_NAME="$(basename "$REPO_DIR")"
echo "Repo: $REPO_NAME"
echo "Dockerfiles:"
find "$REPO_DIR" -maxdepth 2 -name "Dockerfile" -not -path "*/node_modules/*" | sort
2. Run docker-prep to pack @bytelyst/* tarballs
bash scripts/docker-prep.sh
3. Build each Dockerfile
Build each Dockerfile found in the repo. The build context is always the repo root (.).
Tag images as <service>:smoke-test for easy cleanup.
For each Dockerfile found in step 1, run:
# Example for backend:
docker build -f backend/Dockerfile -t "$(basename $(pwd))-backend:smoke-test" . 2>&1 | tail -20
# Example for web:
docker build -f web/Dockerfile -t "$(basename $(pwd))-web:smoke-test" . 2>&1 | tail -20
Adapt the -f path based on actual Dockerfile locations from step 1.
If a build fails, stop and investigate the error before continuing.
4. Restore package.json files
bash scripts/docker-prep.sh --restore
5. Report results
Summarize which images built successfully and which failed. If all passed, the repo's Docker setup is healthy.
6. (Optional) Cleanup smoke-test images
docker images --filter "reference=*:smoke-test" --format "{{.Repository}}:{{.Tag}}" | xargs -r docker rmi
Common Failures
.docker-depsnot found: Run step 2 first, and ensure.dockerignoredoes NOT exclude.docker-deps- Google Fonts / TLS error: Ensure
ENV NODE_TLS_REJECT_UNAUTHORIZED=0is in the builder stage - Native module build failure: Add
python3 make g++toRUN apt-get installin the builder stage public/not found: Remove theCOPY publicline if the web app has nopublic/directory