2023-01-01 16:53:01 +00:00
|
|
|
variable "DOCKER_DEBUG" {
|
|
|
|
default = ""
|
|
|
|
}
|
2022-12-04 01:32:45 +00:00
|
|
|
variable "DOCKER_STATIC" {
|
|
|
|
default = "1"
|
|
|
|
}
|
2023-01-01 16:53:01 +00:00
|
|
|
variable "DOCKER_LDFLAGS" {
|
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
variable "DOCKER_BUILDTAGS" {
|
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
variable "DOCKER_GITCOMMIT" {
|
2023-07-31 16:32:01 +00:00
|
|
|
default = null
|
2023-01-01 16:53:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Docker version such as 23.0.0-dev. Automatically generated through Git ref.
|
|
|
|
variable "VERSION" {
|
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
|
|
|
|
# The platform name, such as "Docker Engine - Community".
|
|
|
|
variable "PLATFORM" {
|
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
|
|
|
|
# The product name, used to set version.ProductName, which is used to set
|
|
|
|
# BuildKit's ExportedProduct variable in order to show useful error messages
|
|
|
|
# to users when a certain version of the product doesn't support a BuildKit feature.
|
|
|
|
variable "PRODUCT" {
|
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
|
|
|
|
# Sets the version.DefaultProductLicense string, such as "Community Engine".
|
|
|
|
# This field can contain a summary of the product license of the daemon if a
|
|
|
|
# commercial license has been applied to the daemon.
|
|
|
|
variable "DEFAULT_PRODUCT_LICENSE" {
|
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
|
|
|
|
# The name of the packager (e.g. "Docker, Inc."). This used to set CompanyName
|
|
|
|
# in the manifest.
|
|
|
|
variable "PACKAGER_NAME" {
|
|
|
|
default = ""
|
|
|
|
}
|
2022-03-14 05:33:50 +00:00
|
|
|
|
2023-05-11 13:45:17 +00:00
|
|
|
# Special target: https://github.com/docker/metadata-action#bake-definition
|
|
|
|
target "docker-metadata-action" {
|
|
|
|
tags = ["moby-bin:local"]
|
|
|
|
}
|
|
|
|
|
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
|
2023-01-01 16:53:01 +00:00
|
|
|
DOCKER_DEBUG = DOCKER_DEBUG
|
2022-12-04 01:32:45 +00:00
|
|
|
DOCKER_STATIC = DOCKER_STATIC
|
2023-01-01 16:53:01 +00:00
|
|
|
DOCKER_LDFLAGS = DOCKER_LDFLAGS
|
|
|
|
DOCKER_BUILDTAGS = DOCKER_BUILDTAGS
|
2023-08-18 14:00:02 +00:00
|
|
|
DOCKER_GITCOMMIT = DOCKER_GITCOMMIT
|
|
|
|
VERSION = VERSION
|
2023-01-01 16:53:01 +00:00
|
|
|
PLATFORM = PLATFORM
|
|
|
|
PRODUCT = PRODUCT
|
|
|
|
DEFAULT_PRODUCT_LICENSE = DEFAULT_PRODUCT_LICENSE
|
|
|
|
PACKAGER_NAME = PACKAGER_NAME
|
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
|
|
|
|
2023-01-18 10:40:37 +00:00
|
|
|
target "binary-smoketest" {
|
|
|
|
inherits = ["_common"]
|
|
|
|
target = "smoketest"
|
|
|
|
output = ["type=cacheonly"]
|
|
|
|
platforms = [
|
|
|
|
"linux/amd64",
|
|
|
|
"linux/arm/v6",
|
|
|
|
"linux/arm/v7",
|
|
|
|
"linux/arm64",
|
|
|
|
"linux/ppc64le",
|
|
|
|
"linux/s390x"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-12-29 14:35:55 +00:00
|
|
|
#
|
|
|
|
# same as binary but with extra tools as well (containerd, runc, ...)
|
|
|
|
#
|
|
|
|
|
|
|
|
target "all" {
|
|
|
|
inherits = ["_common"]
|
|
|
|
target = "all"
|
|
|
|
output = [bindir(DOCKER_STATIC == "1" ? "binary" : "dynbinary")]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "all-cross" {
|
|
|
|
inherits = ["all", "_platforms"]
|
|
|
|
}
|
|
|
|
|
2023-05-11 13:52:13 +00:00
|
|
|
#
|
|
|
|
# bin image
|
|
|
|
#
|
|
|
|
|
|
|
|
target "bin-image" {
|
2023-05-11 13:45:17 +00:00
|
|
|
inherits = ["all", "docker-metadata-action"]
|
2023-05-11 13:52:13 +00:00
|
|
|
output = ["type=docker"]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "bin-image-cross" {
|
|
|
|
inherits = ["bin-image"]
|
|
|
|
output = ["type=image"]
|
|
|
|
platforms = [
|
|
|
|
"linux/amd64",
|
|
|
|
"linux/arm/v6",
|
|
|
|
"linux/arm/v7",
|
|
|
|
"linux/arm64",
|
|
|
|
"linux/ppc64le",
|
|
|
|
"linux/s390x",
|
|
|
|
"windows/amd64"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-08-27 13:05:22 +00:00
|
|
|
#
|
|
|
|
# dev
|
|
|
|
#
|
|
|
|
|
|
|
|
variable "SYSTEMD" {
|
|
|
|
default = "false"
|
|
|
|
}
|
|
|
|
|
|
|
|
target "dev" {
|
|
|
|
inherits = ["_common"]
|
2022-12-26 16:55:57 +00:00
|
|
|
target = "dev"
|
2022-08-27 13:05:22 +00:00
|
|
|
args = {
|
|
|
|
SYSTEMD = SYSTEMD
|
|
|
|
}
|
2022-12-26 16:55:57 +00:00
|
|
|
tags = ["docker-dev"]
|
2022-08-27 13:05:22 +00:00
|
|
|
output = ["type=docker"]
|
|
|
|
}
|