2022-12-04 01:32:45 +00:00
|
|
|
variable "DOCKER_STATIC" {
|
|
|
|
default = "1"
|
|
|
|
}
|
2022-03-14 05:33:50 +00:00
|
|
|
|
2022-12-26 16:45:50 +00:00
|
|
|
# Defines the output folder
|
|
|
|
variable "DESTDIR" {
|
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
function "bindir" {
|
|
|
|
params = [defaultdir]
|
|
|
|
result = DESTDIR != "" ? DESTDIR : "./bundles/${defaultdir}"
|
|
|
|
}
|
|
|
|
|
2022-03-14 05:33:50 +00:00
|
|
|
target "_common" {
|
|
|
|
args = {
|
|
|
|
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
|
2022-04-10 19:03:54 +00:00
|
|
|
APT_MIRROR = "cdn-fastly.deb.debian.org"
|
2022-12-04 01:32:45 +00:00
|
|
|
DOCKER_STATIC = DOCKER_STATIC
|
2022-03-14 05:33:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
group "default" {
|
|
|
|
targets = ["binary"]
|
|
|
|
}
|
|
|
|
|
2023-01-01 16:47:17 +00:00
|
|
|
target "_platforms" {
|
|
|
|
platforms = [
|
|
|
|
"linux/amd64",
|
|
|
|
"linux/arm/v5",
|
|
|
|
"linux/arm/v6",
|
|
|
|
"linux/arm/v7",
|
|
|
|
"linux/arm64",
|
|
|
|
"linux/ppc64le",
|
|
|
|
"linux/s390x",
|
|
|
|
"windows/amd64"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# build dockerd and docker-proxy
|
|
|
|
#
|
|
|
|
|
2022-03-14 05:33:50 +00:00
|
|
|
target "binary" {
|
|
|
|
inherits = ["_common"]
|
|
|
|
target = "binary"
|
2022-12-26 16:45:50 +00:00
|
|
|
output = [bindir(DOCKER_STATIC == "1" ? "binary" : "dynbinary")]
|
2022-03-14 05:33:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
target "dynbinary" {
|
2022-04-10 19:03:54 +00:00
|
|
|
inherits = ["binary"]
|
2022-12-26 16:45:50 +00:00
|
|
|
output = [bindir("dynbinary")]
|
2022-04-10 19:03:54 +00:00
|
|
|
args = {
|
2023-01-01 16:47:17 +00:00
|
|
|
DOCKER_STATIC = "0"
|
2022-04-10 19:03:54 +00:00
|
|
|
}
|
2023-01-01 16:47:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
target "binary-cross" {
|
|
|
|
inherits = ["binary", "_platforms"]
|
2022-04-10 19:03:54 +00:00
|
|
|
}
|
2022-08-27 13:05:22 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# dev
|
|
|
|
#
|
|
|
|
|
|
|
|
variable "DEV_IMAGE" {
|
|
|
|
default = "docker-dev"
|
|
|
|
}
|
|
|
|
variable "SYSTEMD" {
|
|
|
|
default = "false"
|
|
|
|
}
|
|
|
|
|
|
|
|
target "dev" {
|
|
|
|
inherits = ["_common"]
|
|
|
|
target = "final"
|
|
|
|
args = {
|
|
|
|
SYSTEMD = SYSTEMD
|
|
|
|
}
|
|
|
|
tags = [DEV_IMAGE]
|
|
|
|
output = ["type=docker"]
|
|
|
|
}
|