Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ EOT

# htmlproofer checks for broken links
FROM gem AS htmlproofer-base
# FIXME(thaJeztah): remove temporary exclusion rule for buildx_build once anchor links are updated.
RUN --mount=type=bind,from=generate,source=/out,target=_site <<EOF
htmlproofer ./_site \
--disable-external \
--internal-domains="docs.docker.com,docs-stage.docker.com,localhost:4000" \
--file-ignore="/^./_site/engine/api/.*$/,./_site/registry/configuration/index.html,./_site/engine/reference/commandline/buildx_build/index.html" \
--file-ignore="/^./_site/engine/api/.*$/,./_site/registry/configuration/index.html" \
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can safely remove this workaround, cc @thaJeztah

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

htmlproofer looks happy 👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! I think I did it in a separate commit, so possibly a revert would've worked, but not important.

--url-ignore="/^/docker-hub/api/latest/.*$/,/^/engine/api/v.+/#.*$/,/^/glossary/.*$/" > /results 2>&1
rc=$?
if [[ $rc -eq 0 ]]; then
Expand Down
22 changes: 20 additions & 2 deletions _data/buildx/docker_buildx_bake.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ long: |-
Bake is a high-level build command. Each specified target will run in parallel
as part of the build.

Read [High-level build options with Bake](/build/bake/)
Read [High-level build options with Bake](/build/customize/bake/)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dvdksn We should update this link on buildx repo to /build/bake/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oooh I see

guide for introduction to writing bake files.

> **Note**
Expand Down Expand Up @@ -82,6 +82,15 @@ options:
experimentalcli: false
kubernetes: false
swarm: false
- option: provenance
value_type: string
description: Shorthand for `--set=*.attest=type=provenance`
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: pull
value_type: bool
default_value: "false"
Expand All @@ -103,6 +112,15 @@ options:
experimentalcli: false
kubernetes: false
swarm: false
- option: sbom
value_type: string
description: Shorthand for `--set=*.attest=type=sbom`
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: set
value_type: stringArray
default_value: '[]'
Expand Down Expand Up @@ -166,7 +184,7 @@ examples: |-
$ docker buildx bake -f docker-bake.dev.hcl db webapp-release
```

See our [file definition](/build/bake/file-definition/)
See our [file definition](/build/customize/bake/file-definition/)
guide for more details.

### Do not use cache when building the image (--no-cache) {#no-cache}
Expand Down
88 changes: 60 additions & 28 deletions _data/buildx/docker_buildx_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ options:
value_type: stringSlice
default_value: '[]'
description: 'Add a custom host-to-IP mapping (format: `host:ip`)'
details_url: /engine/reference/commandline/build/#add-entries-to-container-hosts-file---add-host
details_url: /engine/reference/commandline/build/#add-host
deprecated: false
hidden: false
experimental: false
Expand All @@ -35,6 +35,16 @@ options:
experimentalcli: false
kubernetes: false
swarm: false
- option: attest
value_type: stringArray
default_value: '[]'
description: 'Attestation parameters (format: `type=sbom,generator=image`)'
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: build-arg
value_type: stringArray
default_value: '[]'
Expand Down Expand Up @@ -84,7 +94,7 @@ options:
- option: cgroup-parent
value_type: string
description: Optional parent cgroup for the container
details_url: /engine/reference/commandline/build/#use-a-custom-parent-cgroup---cgroup-parent
details_url: /engine/reference/commandline/build/#cgroup-parent
deprecated: false
hidden: false
experimental: false
Expand Down Expand Up @@ -154,7 +164,7 @@ options:
shorthand: f
value_type: string
description: 'Name of the Dockerfile (default: `PATH/Dockerfile`)'
details_url: /engine/reference/commandline/build/#specify-a-dockerfile--f
details_url: /engine/reference/commandline/build/#file
deprecated: false
hidden: false
experimental: false
Expand Down Expand Up @@ -324,6 +334,15 @@ options:
experimentalcli: false
kubernetes: false
swarm: false
- option: provenance
value_type: string
description: Shortand for `--attest=type=provenance`
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: pull
value_type: bool
default_value: "false"
Expand Down Expand Up @@ -366,6 +385,15 @@ options:
experimentalcli: false
kubernetes: false
swarm: false
- option: sbom
value_type: string
description: Shorthand for `--attest=type=sbom`
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: secret
value_type: stringArray
default_value: '[]'
Expand Down Expand Up @@ -426,7 +454,7 @@ options:
value_type: stringArray
default_value: '[]'
description: 'Name and optionally a tag (format: `name:tag`)'
details_url: /engine/reference/commandline/build/#tag-an-image--t
details_url: /engine/reference/commandline/build/#tag
deprecated: false
hidden: false
experimental: false
Expand All @@ -436,7 +464,7 @@ options:
- option: target
value_type: string
description: Set the target build stage to build
details_url: /engine/reference/commandline/build/#specifying-target-build-stage---target
details_url: /engine/reference/commandline/build/#target
deprecated: false
hidden: false
experimental: false
Expand Down Expand Up @@ -490,7 +518,7 @@ examples: |-

### Set build-time variables (--build-arg) {#build-arg}

Same as [`docker build` command](/engine/reference/commandline/build/#set-build-time-variables---build-arg).
Same as [`docker build` command](/engine/reference/commandline/build/#build-arg).

There are also useful built-in build args like:

Expand Down Expand Up @@ -531,36 +559,33 @@ examples: |-
# docker buildx build --build-context project=https://github.com/myuser/project.git .
```

```Dockerfile
```dockerfile
# syntax=docker/dockerfile:1
FROM alpine
COPY --from=project myfile /
```

#### Source image from OCI layout directory {#source-oci-layout}

Source an image from a local [OCI layout compliant directory](https://github.com/opencontainers/image-spec/blob/main/image-layout.md):
Source an image from a local [OCI layout compliant directory](https://github.com/opencontainers/image-spec/blob/main/image-layout.md),
either by tag, or by digest:

```console
$ docker buildx build --build-context foo=oci-layout:///path/to/local/layout@sha256:abcd12345 .
$ docker buildx build --build-context foo=oci-layout:///path/to/local/layout:<tag>
$ docker buildx build --build-context foo=oci-layout:///path/to/local/layout@sha256:<digest>
```

```Dockerfile
```dockerfile
# syntax=docker/dockerfile:1
FROM alpine
RUN apk add git

COPY --from=foo myfile /

FROM foo
```

The OCI layout directory must be compliant with the [OCI layout specification](https://github.com/opencontainers/image-spec/blob/main/image-layout.md). It looks _solely_ for hashes. It does not
do any form of `image:tag` resolution to find the hash of the manifest; that is up to you.

The format of the `--build-context` must be: `<context>=oci-layout://<path-to-local-layout>@sha256:<hash-of-manifest>`, where:

* `context` is the name of the build context as used in the `Dockerfile`.
* `path-to-local-layout` is the path on the local machine, where you are running `docker build`, to the spec-compliant OCI layout.
* `hash-of-manifest` is the hash of the manifest for the image. It can be a single-architecture manifest or a multi-architecture index.
The OCI layout directory must be compliant with the [OCI layout specification](https://github.com/opencontainers/image-spec/blob/main/image-layout.md).
You can reference an image in the layout using either tags, or the exact digest.

### Override the configured builder instance (--builder) {#builder}

Expand All @@ -573,7 +598,7 @@ examples: |-
```

Use an external cache source for a build. Supported types are `registry`,
`local` and `gha`.
`local`, `gha` and `s3`.

- [`registry` source](https://github.com/moby/buildkit#registry-push-image-and-cache-separately)
can import cache from a cache manifest or (special) image configuration on the
Expand All @@ -583,6 +608,9 @@ examples: |-
- [`gha` source](https://github.com/moby/buildkit#github-actions-cache-experimental)
can import cache from a previously exported cache with `--cache-to` in your
GitHub repository
- [`s3` source](https://github.com/moby/buildkit#s3-cache-experimental)
can import cache from a previously exported cache with `--cache-to` in your
S3 bucket

If no type is specified, `registry` exporter is used with a specified reference.

Expand All @@ -594,6 +622,7 @@ examples: |-
$ docker buildx build --cache-from=type=registry,ref=user/app .
$ docker buildx build --cache-from=type=local,src=path/to/cache .
$ docker buildx build --cache-from=type=gha .
$ docker buildx build --cache-from=type=s3,region=eu-west-1,bucket=mybucket .
```

More info about cache exporters and available attributes: https://github.com/moby/buildkit#export-cache
Expand All @@ -605,15 +634,17 @@ examples: |-
```

Export build cache to an external cache destination. Supported types are
`registry`, `local`, `inline` and `gha`.
`registry`, `local`, `inline`, `gha` and `s3`.

- [`registry` type](https://github.com/moby/buildkit#registry-push-image-and-cache-separately) exports build cache to a cache manifest in the registry.
- [`local` type](https://github.com/moby/buildkit#local-directory-1) type
exports cache to a local directory on the client.
- [`local` type](https://github.com/moby/buildkit#local-directory-1) exports
cache to a local directory on the client.
- [`inline` type](https://github.com/moby/buildkit#inline-push-image-and-cache-together)
type writes the cache metadata into the image configuration.
writes the cache metadata into the image configuration.
- [`gha` type](https://github.com/moby/buildkit#github-actions-cache-experimental)
type exports cache through the [Github Actions Cache service API](https://github.com/tonistiigi/go-actions-cache/blob/master/api.md#authentication).
exports cache through the [GitHub Actions Cache service API](https://github.com/tonistiigi/go-actions-cache/blob/master/api.md#authentication).
- [`s3` type](https://github.com/moby/buildkit#s3-cache-experimental) exports
cache to a S3 bucket.

`docker` driver currently only supports exporting inline cache metadata to image
configuration. Alternatively, `--build-arg BUILDKIT_INLINE_CACHE=1` can be used
Expand All @@ -631,6 +662,7 @@ examples: |-
$ docker buildx build --cache-to=type=registry,ref=user/app .
$ docker buildx build --cache-to=type=local,dest=path/to/cache .
$ docker buildx build --cache-to=type=gha .
$ docker buildx build --cache-to=type=s3,region=eu-west-1,bucket=mybucket .
```

More info about cache exporters and available attributes: https://github.com/moby/buildkit#export-cache
Expand Down Expand Up @@ -871,7 +903,7 @@ examples: |-
- `src`, `source` - Secret filename. `id` used if unset.

```dockerfile
# syntax=docker/dockerfile:1.4
# syntax=docker/dockerfile:1
FROM python:3
RUN pip install awscli
RUN --mount=type=secret,id=aws,target=/root/.aws/credentials \
Expand All @@ -890,7 +922,7 @@ examples: |-
- `env` - Secret environment variable. `id` used if unset, otherwise will look for `src`, `source` if `id` unset.

```dockerfile
# syntax=docker/dockerfile:1.4
# syntax=docker/dockerfile:1
FROM node:alpine
RUN --mount=type=bind,target=. \
--mount=type=secret,id=SECRET_TOKEN \
Expand Down Expand Up @@ -922,7 +954,7 @@ examples: |-
Example to access Gitlab using an SSH agent socket:

```dockerfile
# syntax=docker/dockerfile:1.4
# syntax=docker/dockerfile:1
FROM alpine
RUN apk add --no-cache openssh-client
RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
Expand Down
18 changes: 8 additions & 10 deletions _data/buildx/docker_buildx_create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ options:
experimentalcli: false
kubernetes: false
swarm: false
- option: builder
value_type: string
deprecated: false
hidden: true
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: buildkitd-flags
value_type: string
description: Flags for buildkitd daemon
Expand Down Expand Up @@ -130,16 +138,6 @@ options:
experimentalcli: false
kubernetes: false
swarm: false
inherited_options:
- option: builder
value_type: string
description: Override the configured builder instance
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
examples: |-
### Append a new node to an existing builder (--append) {#append}

Expand Down
Loading