github.com/tonistiigi/docker@v0.10.1-0.20240229224939-974013b0dc6a/docker-bake.hcl (about) 1 variable "DOCKER_DEBUG" { 2 default = "" 3 } 4 variable "DOCKER_STATIC" { 5 default = "1" 6 } 7 variable "DOCKER_LDFLAGS" { 8 default = "" 9 } 10 variable "DOCKER_BUILDTAGS" { 11 default = "" 12 } 13 variable "DOCKER_GITCOMMIT" { 14 default = null 15 } 16 17 # Docker version such as 23.0.0-dev. Automatically generated through Git ref. 18 variable "VERSION" { 19 default = "" 20 } 21 22 # The platform name, such as "Docker Engine - Community". 23 variable "PLATFORM" { 24 default = "" 25 } 26 27 # The product name, used to set version.ProductName, which is used to set 28 # BuildKit's ExportedProduct variable in order to show useful error messages 29 # to users when a certain version of the product doesn't support a BuildKit feature. 30 variable "PRODUCT" { 31 default = "" 32 } 33 34 # Sets the version.DefaultProductLicense string, such as "Community Engine". 35 # This field can contain a summary of the product license of the daemon if a 36 # commercial license has been applied to the daemon. 37 variable "DEFAULT_PRODUCT_LICENSE" { 38 default = "" 39 } 40 41 # The name of the packager (e.g. "Docker, Inc."). This used to set CompanyName 42 # in the manifest. 43 variable "PACKAGER_NAME" { 44 default = "" 45 } 46 47 # Special target: https://github.com/docker/metadata-action#bake-definition 48 target "docker-metadata-action" { 49 tags = ["moby-bin:local"] 50 } 51 52 # Defines the output folder 53 variable "DESTDIR" { 54 default = "" 55 } 56 function "bindir" { 57 params = [defaultdir] 58 result = DESTDIR != "" ? DESTDIR : "./bundles/${defaultdir}" 59 } 60 61 target "_common" { 62 args = { 63 BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1 64 DOCKER_DEBUG = DOCKER_DEBUG 65 DOCKER_STATIC = DOCKER_STATIC 66 DOCKER_LDFLAGS = DOCKER_LDFLAGS 67 DOCKER_BUILDTAGS = DOCKER_BUILDTAGS 68 DOCKER_GITCOMMIT = DOCKER_GITCOMMIT 69 VERSION = VERSION 70 PLATFORM = PLATFORM 71 PRODUCT = PRODUCT 72 DEFAULT_PRODUCT_LICENSE = DEFAULT_PRODUCT_LICENSE 73 PACKAGER_NAME = PACKAGER_NAME 74 } 75 } 76 77 group "default" { 78 targets = ["binary"] 79 } 80 81 target "_platforms" { 82 platforms = [ 83 "linux/amd64", 84 "linux/arm/v5", 85 "linux/arm/v6", 86 "linux/arm/v7", 87 "linux/arm64", 88 "linux/ppc64le", 89 "linux/s390x", 90 "windows/amd64" 91 ] 92 } 93 94 # 95 # build dockerd and docker-proxy 96 # 97 98 target "binary" { 99 inherits = ["_common"] 100 target = "binary" 101 output = [bindir(DOCKER_STATIC == "1" ? "binary" : "dynbinary")] 102 } 103 104 target "dynbinary" { 105 inherits = ["binary"] 106 output = [bindir("dynbinary")] 107 args = { 108 DOCKER_STATIC = "0" 109 } 110 } 111 112 target "binary-cross" { 113 inherits = ["binary", "_platforms"] 114 } 115 116 target "binary-smoketest" { 117 inherits = ["_common"] 118 target = "smoketest" 119 output = ["type=cacheonly"] 120 platforms = [ 121 "linux/amd64", 122 "linux/arm/v6", 123 "linux/arm/v7", 124 "linux/arm64", 125 "linux/ppc64le", 126 "linux/s390x" 127 ] 128 } 129 130 # 131 # same as binary but with extra tools as well (containerd, runc, ...) 132 # 133 134 target "all" { 135 inherits = ["_common"] 136 target = "all" 137 output = [bindir(DOCKER_STATIC == "1" ? "binary" : "dynbinary")] 138 } 139 140 target "all-cross" { 141 inherits = ["all", "_platforms"] 142 } 143 144 # 145 # bin image 146 # 147 148 target "bin-image" { 149 inherits = ["all", "docker-metadata-action"] 150 output = ["type=docker"] 151 } 152 153 target "bin-image-cross" { 154 inherits = ["bin-image"] 155 output = ["type=image"] 156 platforms = [ 157 "linux/amd64", 158 "linux/arm/v6", 159 "linux/arm/v7", 160 "linux/arm64", 161 "linux/ppc64le", 162 "linux/s390x", 163 "windows/amd64" 164 ] 165 } 166 167 # 168 # dev 169 # 170 171 variable "SYSTEMD" { 172 default = "false" 173 } 174 175 target "dev" { 176 inherits = ["_common"] 177 target = "dev" 178 args = { 179 SYSTEMD = SYSTEMD 180 } 181 tags = ["docker-dev"] 182 output = ["type=docker"] 183 }