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