variable "registry" { default = "repo.nstart.local" } variable "base_repo" { default = "repo.nstart.local/library/" } function "oci_labels" { params = [name, version] result = { "org.opencontainers.image.version" = version, "org.opencontainers.image.vendor" = "New Start", "org.opencontainers.image.authors" = "Sychev Nikita ", "org.opencontainers.image.base.name" = "${base_repo}${name}:${version}", "org.opencontainers.image.title" = "Base image for ${name} with custom CA and local repos", "org.opencontainers.image.description" = "Slim base image for ${name} with internal CA and local package mirrors", } } function "image_ref" { params = [name] result = registry != "" ? "${registry}/nstart/${name}" : "nstart/${name}" } target "image" { name = join("-", compact([ combo.image, replace(combo.distro, ".", "-"), replace(combo.version, ".", "-") ])) matrix = { combo = [ { image = "node", distro= "debian", version = "25-trixie-slim", dockerfile="Dockerfile.node-deb" }, { image = "node", distro= "debian", version = "24-trixie-slim", dockerfile="Dockerfile.node-deb" }, { image = "python", distro= "debian", version = "3.14-slim-trixie", dockerfile="Dockerfile.python-deb" }, { image = "python", distro= "debian", version = "3.13-slim-trixie", dockerfile="Dockerfile.python-deb" }, { image = "eclipse-temurin", distro= "rhel", version = "25-jre-ubi10-minimal", dockerfile="Dockerfile.jre-rhel" }, { image = "gradle", distro= "rhel", version = "jdk25-ubi10", dockerfile="Dockerfile.jdk-rhel" }, { image = "gradle", distro= "ubuntu", version = "jdk17-noble", dockerfile="Dockerfile.jdk-ubuntu" }, { image = "eclipse-temurin", distro= "rhel", version = "17-jre-ubi10-minimal", dockerfile="Dockerfile.jre-rhel" }, { image = "gradle", distro= "rhel", version = "jdk17-ubi10", dockerfile="Dockerfile.jdk-rhel" }, { image = "alpine", distro= "", version = "3.23.2", dockerfile="Dockerfile.alpine" }, { image = "ubuntu", distro= "", version = "24.04", dockerfile="Dockerfile.ubuntu" }, { image = "sonar-scanner-cli", distro= "amazonlinux", version = "12.1", dockerfile="Dockerfile.sonar-amazonlinux" } ] } platforms = ["linux/amd64"] output = ["type=image"] attest = [ "type=sbom,generator=${registry}/docker/buildkit-syft-scanner:stable-1", "type=provenance,mode=max" ] context = "." dockerfile = combo.dockerfile args = { BASE_REPO = base_repo BASE_TAG = combo.version } tags = [ "${image_ref(combo.image)}:${combo.version}", "${image_ref(combo.image)}:latest", ] labels = oci_labels(combo.image, combo.version) } group "all" { targets = ["image"] }