Build a container image with a version tag.

Section: Infrastructure and deployment recipes

Docker build target

makefile
makefile
IMAGE ?= example/app
TAG ?= latest

.PHONY: docker-build
docker-build:
	docker build -t $(IMAGE):$(TAG) .
Explanation

Common deployment building block.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Infrastructure and deployment recipes
Docker push target
Push a previously built image.
OpenIn sheetmakefilesame section
Terraform plan target
Run a named plan file for a chosen environment.
OpenIn sheetmakefilesame section
Terraform apply target
Apply the previously generated plan.
OpenIn sheetmakefilesame section
Deploy static site to S3
Sync built files to a bucket and invalidate a CDN.
OpenIn sheetmakefilesame section
Help target
List available targets and descriptions.
OpenIn sheetmakefile
Node.js targets
Lint, test, and build JavaScript or TypeScript projects.
OpenIn sheetmakefile