github.com/khulnasoft/cli@v0.0.0-20240402070845-01bcad7beefa/docker-bake.hcl (about)

     1  variable "GO_VERSION" {
     2      default = "1.21.8"
     3  }
     4  variable "VERSION" {
     5      default = ""
     6  }
     7  variable "USE_GLIBC" {
     8      default = ""
     9  }
    10  variable "STRIP_TARGET" {
    11      default = ""
    12  }
    13  variable "IMAGE_NAME" {
    14      default = "docker-cli"
    15  }
    16  
    17  # Sets the name of the company that produced the windows binary.
    18  variable "PACKAGER_NAME" {
    19      default = ""
    20  }
    21  
    22  target "_common" {
    23      args = {
    24          GO_VERSION = GO_VERSION
    25          BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
    26      }
    27  }
    28  
    29  target "_platforms" {
    30      platforms = [
    31          "darwin/amd64",
    32          "darwin/arm64",
    33          "linux/amd64",
    34          "linux/arm/v6",
    35          "linux/arm/v7",
    36          "linux/arm64",
    37          "linux/ppc64le",
    38          "linux/riscv64",
    39          "linux/s390x",
    40          "windows/amd64",
    41          "windows/arm64"
    42      ]
    43  }
    44  
    45  group "default" {
    46      targets = ["binary"]
    47  }
    48  
    49  target "binary" {
    50      inherits = ["_common"]
    51      target = "binary"
    52      platforms = ["local"]
    53      output = ["build"]
    54      args = {
    55          BASE_VARIANT = USE_GLIBC == "1" ? "debian" : "alpine"
    56          VERSION = VERSION
    57          PACKAGER_NAME = PACKAGER_NAME
    58          GO_STRIP = STRIP_TARGET
    59      }
    60  }
    61  
    62  target "dynbinary" {
    63      inherits = ["binary"]
    64      args = {
    65          GO_LINKMODE = "dynamic"
    66      }
    67  }
    68  
    69  target "plugins" {
    70      inherits = ["_common"]
    71      target = "plugins"
    72      platforms = ["local"]
    73      output = ["build"]
    74      args = {
    75          BASE_VARIANT = USE_GLIBC == "1" ? "debian" : "alpine"
    76          VERSION = VERSION
    77          GO_STRIP = STRIP_TARGET
    78      }
    79  }
    80  
    81  target "cross" {
    82      inherits = ["binary", "_platforms"]
    83  }
    84  
    85  target "dynbinary-cross" {
    86      inherits = ["dynbinary", "_platforms"]
    87  }
    88  
    89  target "plugins-cross" {
    90      inherits = ["plugins", "_platforms"]
    91  }
    92  
    93  target "lint" {
    94      inherits = ["_common"]
    95      dockerfile = "./dockerfiles/Dockerfile.lint"
    96      target = "lint"
    97      output = ["type=cacheonly"]
    98  }
    99  
   100  target "shellcheck" {
   101      inherits = ["_common"]
   102      dockerfile = "./dockerfiles/Dockerfile.shellcheck"
   103      target = "shellcheck"
   104      output = ["type=cacheonly"]
   105  }
   106  
   107  target "validate-vendor" {
   108      inherits = ["_common"]
   109      dockerfile = "./dockerfiles/Dockerfile.vendor"
   110      target = "validate"
   111      output = ["type=cacheonly"]
   112  }
   113  
   114  target "update-vendor" {
   115      inherits = ["_common"]
   116      dockerfile = "./dockerfiles/Dockerfile.vendor"
   117      target = "update"
   118      output = ["."]
   119  }
   120  
   121  target "mod-outdated" {
   122      inherits = ["_common"]
   123      dockerfile = "./dockerfiles/Dockerfile.vendor"
   124      target = "outdated"
   125      no-cache-filter = ["outdated"]
   126      output = ["type=cacheonly"]
   127  }
   128  
   129  target "validate-authors" {
   130      inherits = ["_common"]
   131      dockerfile = "./dockerfiles/Dockerfile.authors"
   132      target = "validate"
   133      output = ["type=cacheonly"]
   134  }
   135  
   136  target "update-authors" {
   137      inherits = ["_common"]
   138      dockerfile = "./dockerfiles/Dockerfile.authors"
   139      target = "update"
   140      output = ["."]
   141  }
   142  
   143  target "test" {
   144      target = "test"
   145      output = ["type=cacheonly"]
   146  }
   147  
   148  target "test-coverage" {
   149      target = "test-coverage"
   150      output = ["build/coverage"]
   151  }
   152  
   153  target "e2e-image" {
   154      target = "e2e"
   155      output = ["type=docker"]
   156      tags = ["${IMAGE_NAME}"]
   157      args = {
   158          BASE_VARIANT = USE_GLIBC == "1" ? "debian" : "alpine"
   159          VERSION = VERSION
   160      }
   161  }
   162  
   163  target "e2e-gencerts" {
   164      inherits = ["_common"]
   165      dockerfile = "./e2e/testdata/Dockerfile.gencerts"
   166      output = ["./e2e/testdata"]
   167  }
   168  
   169  target "docker-metadata-action" {
   170    tags = ["cli-bin:local"]
   171  }
   172  
   173  target "bin-image" {
   174    inherits = ["binary", "docker-metadata-action"]
   175    target = "bin-image"
   176    output = ["type=docker"]
   177  }
   178  
   179  target "bin-image-cross" {
   180    inherits = ["bin-image"]
   181    output = ["type=image"]
   182    platforms = [
   183      "linux/amd64",
   184      "linux/arm/v6",
   185      "linux/arm/v7",
   186      "linux/arm64",
   187      "linux/ppc64le",
   188      "linux/s390x",
   189      "windows/amd64",
   190      "windows/arm64"
   191    ]
   192  }