docker-bastion/docker-bake.hcl

38 lines
901 B
HCL
Raw Normal View History

# ===========================================================================
# docker-bastion — multi-platform build
#
# Usage:
# docker buildx bake
# docker buildx bake --set "*.platform=linux/amd64,linux/arm64"
#
# Override registry / name:
# REGISTRY=ghcr.io/myorg IMAGE_NAME=docker-bastion docker buildx bake
# ===========================================================================
variable "REGISTRY" {
default = ""
}
variable "IMAGE_NAME" {
default = "docker-bastion"
}
variable "ALPINE_VERSION" {
default = "3.21"
}
function "tag" {
params = [name]
result = REGISTRY != "" ? "${REGISTRY}/${IMAGE_NAME}:${name}" : "${IMAGE_NAME}:${name}"
}
target "default" {
context = "."
dockerfile = "Dockerfile"
args = {
ALPINE_VERSION = "${ALPINE_VERSION}"
}
platforms = ["linux/amd64", "linux/arm64"]
tags = [tag("latest"), tag("alpine${ALPINE_VERSION}")]
}