Skip to content

CICD-115 · Build with explicit context ​

Encyclopedia · Docker image building · All snippets

Previous · CICD-114 · Next · CICD-116

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 -f deploy/Dockerfile -t web:ci services/web

3. How it works ​

Docker sends the selected context to the builder. The Dockerfile instructions and ignore rules determine what reaches the resulting image.

4. Verify the result ​

COPY sources are relative to services/web. Include deploy/Dockerfile separately.

Validation syntax-validated (Bash parse). Status definitions.