88 lines
1.8 KiB
HCL
88 lines
1.8 KiB
HCL
group "default" {
|
|
targets = [
|
|
"0_41_2",
|
|
]
|
|
}
|
|
|
|
target "build-dockerfile" {
|
|
dockerfile = "Dockerfile"
|
|
}
|
|
|
|
target "build-platforms" {
|
|
platforms = ["linux/amd64", "linux/aarch64"]
|
|
}
|
|
|
|
target "build-platforms-cudnn" {
|
|
platforms = ["linux/amd64"]
|
|
}
|
|
|
|
target "build-common" {
|
|
pull = true
|
|
}
|
|
|
|
######################
|
|
# Define the variables
|
|
######################
|
|
|
|
variable "REGISTRY_CACHE" {
|
|
default = "dcrl.xrf.nu/router0/infisical-cli-cache"
|
|
}
|
|
|
|
######################
|
|
# Define the functions
|
|
######################
|
|
|
|
# Get the arguments for the build
|
|
function "get-args" {
|
|
params = [infisical_cli_version, alpine_version]
|
|
result = {
|
|
INFISICAL_CLI_VERSION = infisical_cli_version
|
|
ALPINE_VERSION = alpine_version
|
|
}
|
|
}
|
|
|
|
# Get the cache-from configuration
|
|
function "get-cache-from" {
|
|
params = [version]
|
|
result = [
|
|
"type=registry,ref=${REGISTRY_CACHE}:${sha1("${version}-${BAKE_LOCAL_PLATFORM}")}"
|
|
]
|
|
}
|
|
|
|
# Get the cache-to configuration
|
|
function "get-cache-to" {
|
|
params = [version]
|
|
result = [
|
|
"type=registry,mode=max,ref=${REGISTRY_CACHE}:${sha1("${version}-${BAKE_LOCAL_PLATFORM}")}"
|
|
]
|
|
}
|
|
|
|
# Get list of image tags and registries
|
|
# Takes a version and a list of extra versions to tag
|
|
# eg. get-tags("0.29.0", ["0.29", "latest"])
|
|
function "get-tags" {
|
|
params = [version, extra_versions]
|
|
result = concat(
|
|
[
|
|
"xcr.se/router0/infisical-cli:${version}"
|
|
],
|
|
flatten([
|
|
for extra_version in extra_versions : [
|
|
"xcr.se/router0/infisical-cli:${extra_version}"
|
|
]
|
|
])
|
|
)
|
|
}
|
|
|
|
##########################
|
|
# Define the build targets
|
|
##########################
|
|
|
|
target "0_41_2" {
|
|
inherits = ["build-dockerfile", "build-platforms", "build-common"]
|
|
cache-from = get-cache-from("0.41.2")
|
|
cache-to = get-cache-to("0.41.2")
|
|
tags = get-tags("0.41.2", ["0.41", "latest"])
|
|
args = get-args("0.41.2", "3.21")
|
|
}
|