2021-03-03 02:03:02 -05:00
|
|
|
variable "VERSION" {
|
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
variable "USE_GLIBC" {
|
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
variable "STRIP_TARGET" {
|
|
|
|
default = ""
|
|
|
|
}
|
2021-11-17 11:18:15 -05:00
|
|
|
variable "IMAGE_NAME" {
|
|
|
|
default = "docker-cli"
|
|
|
|
}
|
2021-03-03 02:03:02 -05:00
|
|
|
|
2021-10-11 10:54:09 -04:00
|
|
|
# Sets the name of the company that produced the windows binary.
|
|
|
|
variable "COMPANY_NAME" {
|
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
|
2021-03-03 02:03:02 -05:00
|
|
|
group "default" {
|
|
|
|
targets = ["binary"]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "binary" {
|
|
|
|
target = "binary"
|
|
|
|
platforms = ["local"]
|
|
|
|
output = ["build"]
|
|
|
|
args = {
|
|
|
|
BASE_VARIANT = USE_GLIBC != "" ? "buster" : "alpine"
|
|
|
|
VERSION = VERSION
|
2021-10-11 10:54:09 -04:00
|
|
|
COMPANY_NAME = COMPANY_NAME
|
2021-03-03 02:03:02 -05:00
|
|
|
GO_STRIP = STRIP_TARGET
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
target "dynbinary" {
|
|
|
|
inherits = ["binary"]
|
|
|
|
args = {
|
|
|
|
GO_LINKMODE = "dynamic"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-17 11:18:15 -05:00
|
|
|
target "plugins" {
|
|
|
|
target = "plugins"
|
|
|
|
platforms = ["local"]
|
|
|
|
output = ["build"]
|
|
|
|
args = {
|
|
|
|
BASE_VARIANT = USE_GLIBC != "" ? "buster" : "alpine"
|
|
|
|
VERSION = VERSION
|
|
|
|
GO_STRIP = STRIP_TARGET
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-26 12:01:38 -04:00
|
|
|
target "platforms" {
|
|
|
|
platforms = concat(["linux/amd64", "linux/386", "linux/arm64", "linux/arm", "linux/ppc64le", "linux/s390x", "darwin/amd64", "darwin/arm64", "windows/amd64", "windows/arm", "windows/386"], USE_GLIBC!=""?[]:["windows/arm64"])
|
2021-03-03 02:03:02 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
target "cross" {
|
2021-09-26 12:01:38 -04:00
|
|
|
inherits = ["binary", "platforms"]
|
2021-03-03 02:03:02 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
target "dynbinary-cross" {
|
2021-09-26 12:01:38 -04:00
|
|
|
inherits = ["dynbinary", "platforms"]
|
2021-03-03 02:03:02 -05:00
|
|
|
}
|
2021-08-05 02:44:16 -04:00
|
|
|
|
2021-11-17 11:18:15 -05:00
|
|
|
target "plugins-cross" {
|
|
|
|
inherits = ["plugins", "platforms"]
|
|
|
|
}
|
|
|
|
|
2021-08-05 02:44:16 -04:00
|
|
|
target "lint" {
|
|
|
|
dockerfile = "./dockerfiles/Dockerfile.lint"
|
|
|
|
target = "lint"
|
|
|
|
output = ["type=cacheonly"]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "shellcheck" {
|
|
|
|
dockerfile = "./dockerfiles/Dockerfile.shellcheck"
|
|
|
|
target = "shellcheck"
|
|
|
|
output = ["type=cacheonly"]
|
|
|
|
}
|
2021-11-17 11:18:15 -05:00
|
|
|
|
|
|
|
target "e2e-image" {
|
|
|
|
target = "e2e"
|
|
|
|
output = ["type=docker"]
|
|
|
|
tags = ["${IMAGE_NAME}"]
|
|
|
|
args = {
|
|
|
|
BASE_VARIANT = USE_GLIBC != "" ? "buster" : "alpine"
|
|
|
|
VERSION = VERSION
|
|
|
|
}
|
|
|
|
}
|