build

ℹ️
This command is fully cacheable.

Build a Dockerfile. Push the image to registry if CI.

@docker build {
    image = "ghcr.io/example/project"
    dockerfile = "Dockerfile"
    platforms = "linux/amd64"
    build_args = { configuration: "Release" }
    args = "--debug"
}

Argument Reference

The following arguments are supported:

  • image - (Required) Docker image to build.
  • dockerfile - (Optional) Use alternative Dockerfile. Default is Dockerfile.
  • platforms - (Optional) Target platform. Default is host.
  • build_args - (Optional) Named arguments to build image (see Dockerfile ARG).
  • args - (Optional) Arguments for command.
Last updated on