CICD-113 · Build a tagged image locally
Encyclopedia · Docker image building · All snippets
Previous · CICD-112 · Next · CICD-114
1. Where it fits
- Placement Bash run step following checkout, or equivalent lab terminal.
- Prerequisites Docker Engine or BuildKit on a trusted lab runner.
- Platforms local-linux, github-actions, gitea-actions.
2. Copy the snippet
bash
docker build -t web:ci .
docker image inspect web:ci --format '{{.Id}}'3. How it works
Docker sends the selected context to the builder. The Dockerfile instructions and ignore rules determine what reaches the resulting image. Inspect reads image metadata rather than launching the application. Use the returned field as an explicit metadata assertion.
4. Verify the result
Use Dockerfile at context root and record an image ID.
Validation syntax-validated (Bash parse). Status definitions.