variable "registry" { default = "repo.nstart.local" } variable "VERSION" { default = "1.0.11" } variable "EXPORT_TYPE" { default = "oci" } function "oci_labels" { params = [name] result = { "org.opencontainers.image.version" = VERSION, "org.opencontainers.image.vendor" = "New Start", "org.opencontainers.image.authors" = "Sychev Nikita ", } } function "image_ref" { params = [name] result = registry != "" ? "${registry}/nstart/${name}" : "nstart/${name}" } target "common" { platforms = ["linux/amd64"] output = ["type=image"] attest = [ "type=sbom,generator=${registry}/docker/buildkit-syft-scanner:stable-1", "type=provenance,mode=max" ] } target "svace" { matrix = { combo = [ { name = "svace" } ] } inherits = ["common"] context = "." dockerfile = "Dockerfile" tags = [ "${image_ref(combo.name)}:${VERSION}", "${image_ref(combo.name)}:latest" ] labels = merge( oci_labels(combo.name), { "org.opencontainers.image.base.name" = "${registry}/library/nginx:1.29.1-alpine" } ) } target "save" { matrix = { combo = [ { name = "svace_save", svc = "svace" } ] } name = combo.name inherits = [combo.svc] output = [ "type=${EXPORT_TYPE},dest=./dist/nstart-${combo.svc}-${VERSION}.tar" ] } group "all" { targets = ["svace"] }