github.com/rumpl/bof@v23.0.0-rc.2+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  # Defines the output folder
    63  variable "DESTDIR" {
    64    default = ""
    65  }
    66  function "bindir" {
    67    params = [defaultdir]
    68    result = DESTDIR != "" ? DESTDIR : "./bundles/${defaultdir}"
    69  }
    70  
    71  target "_common" {
    72    args = {
    73      BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
    74      APT_MIRROR = APT_MIRROR
    75      DOCKER_DEBUG = DOCKER_DEBUG
    76      DOCKER_STATIC = DOCKER_STATIC
    77      DOCKER_LDFLAGS = DOCKER_LDFLAGS
    78      DOCKER_BUILDTAGS = DOCKER_BUILDTAGS
    79      DOCKER_GITCOMMIT = DOCKER_GITCOMMIT != "" ? DOCKER_GITCOMMIT : GITHUB_SHA
    80      VERSION = VERSION != "" ? VERSION : GITHUB_REF
    81      PLATFORM = PLATFORM
    82      PRODUCT = PRODUCT
    83      DEFAULT_PRODUCT_LICENSE = DEFAULT_PRODUCT_LICENSE
    84      PACKAGER_NAME = PACKAGER_NAME
    85    }
    86  }
    87  
    88  group "default" {
    89    targets = ["binary"]
    90  }
    91  
    92  target "_platforms" {
    93    platforms = [
    94      "linux/amd64",
    95      "linux/arm/v5",
    96      "linux/arm/v6",
    97      "linux/arm/v7",
    98      "linux/arm64",
    99      "linux/ppc64le",
   100      "linux/s390x",
   101      "windows/amd64"
   102    ]
   103  }
   104  
   105  #
   106  # build dockerd and docker-proxy
   107  #
   108  
   109  target "binary" {
   110    inherits = ["_common"]
   111    target = "binary"
   112    output = [bindir(DOCKER_STATIC == "1" ? "binary" : "dynbinary")]
   113  }
   114  
   115  target "dynbinary" {
   116    inherits = ["binary"]
   117    output = [bindir("dynbinary")]
   118    args = {
   119      DOCKER_STATIC = "0"
   120    }
   121  }
   122  
   123  target "binary-cross" {
   124    inherits = ["binary", "_platforms"]
   125  }
   126  
   127  #
   128  # same as binary but with extra tools as well (containerd, runc, ...)
   129  #
   130  
   131  target "all" {
   132    inherits = ["_common"]
   133    target = "all"
   134    output = [bindir(DOCKER_STATIC == "1" ? "binary" : "dynbinary")]
   135  }
   136  
   137  target "all-cross" {
   138    inherits = ["all", "_platforms"]
   139  }
   140  
   141  #
   142  # dev
   143  #
   144  
   145  variable "SYSTEMD" {
   146    default = "false"
   147  }
   148  
   149  target "dev" {
   150    inherits = ["_common"]
   151    target = "dev"
   152    args = {
   153      SYSTEMD = SYSTEMD
   154    }
   155    tags = ["docker-dev"]
   156    output = ["type=docker"]
   157  }