From 812b82cd0d6d2ac3a6ffc68c260117a96eef19d4 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:39:12 +0100 Subject: [PATCH] vendor: github.com/docker/buildx v0.18.0 Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- .../docker/buildx/docs/bake-reference.md | 2 +- _vendor/modules.txt | 2 +- data/buildx/docker_buildx.yaml | 1 + data/buildx/docker_buildx_build.yaml | 81 +++++++++++++++---- data/buildx/docker_buildx_imagetools.yaml | 1 + data/buildx/docker_buildx_ls.yaml | 10 +++ data/buildx/docker_buildx_prune.yaml | 30 +++++++ go.mod | 4 +- go.sum | 2 + 9 files changed, 115 insertions(+), 18 deletions(-) diff --git a/_vendor/github.com/docker/buildx/docs/bake-reference.md b/_vendor/github.com/docker/buildx/docs/bake-reference.md index b60d391c89..fd0ee7e1fd 100644 --- a/_vendor/github.com/docker/buildx/docs/bake-reference.md +++ b/_vendor/github.com/docker/buildx/docs/bake-reference.md @@ -844,7 +844,7 @@ The following example forces the builder to always pull all images referenced in ```hcl target "default" { - pull = "always" + pull = true } ``` diff --git a/_vendor/modules.txt b/_vendor/modules.txt index 953442d128..9c9a249884 100644 --- a/_vendor/modules.txt +++ b/_vendor/modules.txt @@ -1,6 +1,6 @@ # github.com/moby/moby v27.3.1+incompatible # github.com/moby/buildkit v0.17.0 -# github.com/docker/buildx v0.17.1 +# github.com/docker/buildx v0.18.0 # github.com/docker/cli v27.3.2-0.20241008150905-cb3048fbebb1+incompatible # github.com/docker/compose/v2 v2.30.1 # github.com/docker/scout-cli v1.13.0 diff --git a/data/buildx/docker_buildx.yaml b/data/buildx/docker_buildx.yaml index 27f0d5e754..c13fe0b3c3 100644 --- a/data/buildx/docker_buildx.yaml +++ b/data/buildx/docker_buildx.yaml @@ -1,6 +1,7 @@ command: docker buildx short: Docker Buildx long: Extended build capabilities with BuildKit +usage: docker buildx pname: docker plink: docker.yaml cname: diff --git a/data/buildx/docker_buildx_build.yaml b/data/buildx/docker_buildx_build.yaml index b2591eb155..b1dc9c44de 100644 --- a/data/buildx/docker_buildx_build.yaml +++ b/data/buildx/docker_buildx_build.yaml @@ -1115,7 +1115,7 @@ examples: |- ```dockerfile # syntax=docker/dockerfile:1 - FROM oven/bun:1 as base + FROM oven/bun:1 AS base WORKDIR /app FROM base AS install @@ -1401,17 +1401,39 @@ examples: |- Supported types are: - - [`file`](#file) - - [`env`](#env) + - [`type=file`](#typefile) + - [`type=env`](#typeenv) - Buildx attempts to detect the `type` automatically if unset. + Buildx attempts to detect the `type` automatically if unset. If an environment + variable with the same key as `id` is set, then Buildx uses `type=env` and the + variable value becomes the secret. If no such environment variable is set, and + `type` is not set, then Buildx falls back to `type=file`. - #### `file` + #### `type=file` - Attribute keys: + Source a build secret from a file. - - `id` - ID of the secret. Defaults to base name of the `src` path. - - `src`, `source` - Secret filename. `id` used if unset. + ##### `type=file` synopsis + + ```console + $ docker buildx build --secret [type=file,]id=[,src=] . + ``` + + ##### `type=file` attributes + + | Key | Description | Default | + | --------------- | ----------------------------------------------------------------------------------------------------- | -------------------------- | + | `id` | ID of the secret. | N/A (this key is required) | + | `src`, `source` | Filepath of the file containing the secret value (absolute or relative to current working directory). | `id` if unset. | + + ###### `type=file` usage + + In the following example, `type=file` is automatically detected because no + environment variable mathing `aws` (the ID) is set. + + ```console + $ docker buildx build --secret id=aws,src=$HOME/.aws/credentials . + ``` ```dockerfile # syntax=docker/dockerfile:1 @@ -1421,16 +1443,31 @@ examples: |- aws s3 cp s3://... ... ``` + #### `type=env` + + Source a build secret from an environment variable. + + ##### `type=env` synopsis + ```console - $ docker buildx build --secret id=aws,src=$HOME/.aws/credentials . + $ docker buildx build --secret [type=env,]id=[,env=] . ``` - #### `env` + ##### `type=env` attributes - Attribute keys: + | Key | Description | Default | + | ---------------------- | ----------------------------------------------- | -------------------------- | + | `id` | ID of the secret. | N/A (this key is required) | + | `env`, `src`, `source` | Environment variable to source the secret from. | `id` if unset. | - - `id` - ID of the secret. Defaults to `env` name. - - `env` - Secret environment variable. `id` used if unset, otherwise will look for `src`, `source` if `id` unset. + ##### `type=env` usage + + In the following example, `type=env` is automatically detected because an + environment variable matching `id` is set. + + ```console + $ SECRET_TOKEN=token docker buildx build --secret id=SECRET_TOKEN . + ``` ```dockerfile # syntax=docker/dockerfile:1 @@ -1440,10 +1477,26 @@ examples: |- yarn run test ``` + In the following example, the build argument `SECRET_TOKEN` is set to contain + the value of the environment variable `API_KEY`. + ```console - $ SECRET_TOKEN=token docker buildx build --secret id=SECRET_TOKEN . + $ API_KEY=token docker buildx build --secret id=SECRET_TOKEN,env=API_KEY . ``` + You can also specify the name of the environment variable with `src` or `source`: + + ```console + $ API_KEY=token docker buildx build --secret type=env,id=SECRET_TOKEN,src=API_KEY . + ``` + + > [!NOTE] + > Specifying the environment variable name with `src` or `source`, you are + > required to set `type=env` explicitly, or else Buildx assumes that the secret + > is `type=file`, and looks for a file with the name of `src` or `source` (in + > this case, a file named `API_KEY` relative to the location where the `docker + > buildx build` command was executed. + ### Shared memory size for build containers (--shm-size) {#shm-size} Sets the size of the shared memory allocated for build containers when using diff --git a/data/buildx/docker_buildx_imagetools.yaml b/data/buildx/docker_buildx_imagetools.yaml index 7f1aef5292..a4aa11744a 100644 --- a/data/buildx/docker_buildx_imagetools.yaml +++ b/data/buildx/docker_buildx_imagetools.yaml @@ -4,6 +4,7 @@ long: |- The `imagetools` commands contains subcommands for working with manifest lists in container registries. These commands are useful for inspecting manifests to check multi-platform configuration and attestations. +usage: docker buildx imagetools pname: docker buildx plink: docker_buildx.yaml cname: diff --git a/data/buildx/docker_buildx_ls.yaml b/data/buildx/docker_buildx_ls.yaml index ec39413949..29cdd2ceb5 100644 --- a/data/buildx/docker_buildx_ls.yaml +++ b/data/buildx/docker_buildx_ls.yaml @@ -39,6 +39,16 @@ options: experimentalcli: false kubernetes: false swarm: false + - option: no-trunc + value_type: bool + default_value: "false" + description: Don't truncate output + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false inherited_options: - option: debug shorthand: D diff --git a/data/buildx/docker_buildx_prune.yaml b/data/buildx/docker_buildx_prune.yaml index a31e9caea4..9accff771c 100644 --- a/data/buildx/docker_buildx_prune.yaml +++ b/data/buildx/docker_buildx_prune.yaml @@ -57,6 +57,36 @@ options: value_type: bytes default_value: "0" description: Amount of disk space to keep for cache + deprecated: true + hidden: true + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: max-used-space + value_type: bytes + default_value: "0" + description: Maximum amount of disk space allowed to keep for cache + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: min-free-space + value_type: bytes + default_value: "0" + description: Target amount of free disk space after pruning + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: reserved-space + value_type: bytes + default_value: "0" + description: Amount of disk space always allowed to keep for cache deprecated: false hidden: false experimental: false diff --git a/go.mod b/go.mod index e9557b2c2e..8622208447 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/docker/docs go 1.23.1 require ( - github.com/docker/buildx v0.17.1 // indirect + github.com/docker/buildx v0.18.0 // indirect github.com/docker/cli v27.3.2-0.20241008150905-cb3048fbebb1+incompatible // indirect github.com/docker/compose/v2 v2.30.1 // indirect github.com/docker/scout-cli v1.13.0 // indirect @@ -12,7 +12,7 @@ require ( ) replace ( - github.com/docker/buildx => github.com/docker/buildx v0.17.1 + github.com/docker/buildx => github.com/docker/buildx v0.18.0 github.com/docker/cli => github.com/docker/cli v27.3.1+incompatible github.com/docker/compose/v2 => github.com/docker/compose/v2 v2.30.1 github.com/docker/scout-cli => github.com/docker/scout-cli v1.13.0 diff --git a/go.sum b/go.sum index 4a41bcbb15..685216fc85 100644 --- a/go.sum +++ b/go.sum @@ -82,6 +82,8 @@ github.com/docker/buildx v0.17.0 h1:Z+QQxsJJPldaeU/4aNXoudFwDDK0/ALFYmDcP5q5fiY= github.com/docker/buildx v0.17.0/go.mod h1:sBKkoZFs+R2D6ARyQ4/GE/FQHHFsl9PkHdvv/GXAsMo= github.com/docker/buildx v0.17.1 h1:9ob2jGp4+W9PxWw68GsoNFp+eYFc7eUoRL9VljLCSM4= github.com/docker/buildx v0.17.1/go.mod h1:kJOhOhS47LRvrLFRulFiO5SE6VJf54yYMn7DzjgO5W0= +github.com/docker/buildx v0.18.0 h1:rSauXHeJt90NvtXrLK5J992Eb0UPJZs2vV3u1zTf1nE= +github.com/docker/buildx v0.18.0/go.mod h1:JGNSshOhHs5FhG3u51jXUf4lLOeD2QBIlJ2vaRB67p4= github.com/docker/cli v24.0.2+incompatible h1:QdqR7znue1mtkXIJ+ruQMGQhpw2JzMJLRXp6zpzF6tM= github.com/docker/cli v24.0.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v24.0.4+incompatible h1:Y3bYF9ekNTm2VFz5U/0BlMdJy73D+Y1iAAZ8l63Ydzw=