github.com/Prakhar-Agarwal-byte/moby@v0.0.0-20231027092010-a14e3e8ab87e/docker-bake.hcl (about)

     1  variable "APT_MIRROR" {
     2    default = ""
     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 = null
    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  # Special target: https://github.com/docker/metadata-action#bake-definition
    51  target "docker-metadata-action" {
    52    tags = ["moby-bin:local"]
    53  }
    54  
    55  # Defines the output folder
    56  variable "DESTDIR" {
    57    default = ""
    58  }
    59  function "bindir" {
    60    params = [defaultdir]
    61    result = DESTDIR != "" ? DESTDIR : "./bundles/${defaultdir}"
    62  }
    63  
    64  target "_common" {
    65    args = {
    66      BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
    67      APT_MIRROR = APT_MIRROR
    68      DOCKER_DEBUG = DOCKER_DEBUG
    69      DOCKER_STATIC = DOCKER_STATIC
    70      DOCKER_LDFLAGS = DOCKER_LDFLAGS
    71      DOCKER_BUILDTAGS = DOCKER_BUILDTAGS
    72      DOCKER_GITCOMMIT = DOCKER_GITCOMMIT
    73      VERSION = VERSION
    74      PLATFORM = PLATFORM
    75      PRODUCT = PRODUCT
    76      DEFAULT_PRODUCT_LICENSE = DEFAULT_PRODUCT_LICENSE
    77      PACKAGER_NAME = PACKAGER_NAME
    78    }
    79  }
    80  
    81  group "default" {
    82    targets = ["binary"]
    83  }
    84  
    85  target "_platforms" {
    86    platforms = [
    87      "linux/amd64",
    88      "linux/arm/v5",
    89      "linux/arm/v6",
    90      "linux/arm/v7",
    91      "linux/arm64",
    92      "linux/ppc64le",
    93      "linux/s390x",
    94      "windows/amd64"
    95    ]
    96  }
    97  
    98  #
    99  # build dockerd and docker-proxy
   100  #
   101  
   102  target "binary" {
   103    inherits = ["_common"]
   104    target = "binary"
   105    output = [bindir(DOCKER_STATIC == "1" ? "binary" : "dynbinary")]
   106  }
   107  
   108  target "dynbinary" {
   109    inherits = ["binary"]
   110    output = [bindir("dynbinary")]
   111    args = {
   112      DOCKER_STATIC = "0"
   113    }
   114  }
   115  
   116  target "binary-cross" {
   117    inherits = ["binary", "_platforms"]
   118  }
   119  
   120  target "binary-smoketest" {
   121    inherits = ["_common"]
   122    target = "smoketest"
   123    output = ["type=cacheonly"]
   124    platforms = [
   125      "linux/amd64",
   126      "linux/arm/v6",
   127      "linux/arm/v7",
   128      "linux/arm64",
   129      "linux/ppc64le",
   130      "linux/s390x"
   131    ]
   132  }
   133  
   134  #
   135  # same as binary but with extra tools as well (containerd, runc, ...)
   136  #
   137  
   138  target "all" {
   139    inherits = ["_common"]
   140    target = "all"
   141    output = [bindir(DOCKER_STATIC == "1" ? "binary" : "dynbinary")]
   142  }
   143  
   144  target "all-cross" {
   145    inherits = ["all", "_platforms"]
   146  }
   147  
   148  #
   149  # bin image
   150  #
   151  
   152  target "bin-image" {
   153    inherits = ["all", "docker-metadata-action"]
   154    output = ["type=docker"]
   155  }
   156  
   157  target "bin-image-cross" {
   158    inherits = ["bin-image"]
   159    output = ["type=image"]
   160    platforms = [
   161      "linux/amd64",
   162      "linux/arm/v6",
   163      "linux/arm/v7",
   164      "linux/arm64",
   165      "linux/ppc64le",
   166      "linux/s390x",
   167      "windows/amd64"
   168    ]
   169  }
   170  
   171  #
   172  # dev
   173  #
   174  
   175  variable "SYSTEMD" {
   176    default = "false"
   177  }
   178  
   179  target "dev" {
   180    inherits = ["_common"]
   181    target = "dev"
   182    args = {
   183      SYSTEMD = SYSTEMD
   184    }
   185    tags = ["docker-dev"]
   186    output = ["type=docker"]
   187  }