diff --git a/.github/vale/Vocab/Industry/accept.txt b/.github/vale/Vocab/Industry/accept.txt index eb0f8a9198..6c4b090737 100644 --- a/.github/vale/Vocab/Industry/accept.txt +++ b/.github/vale/Vocab/Industry/accept.txt @@ -1,6 +1,7 @@ ARM AWS Amazon +Anchore Apple Artifactory Azure( Blob Storage)? @@ -43,7 +44,10 @@ QEMU RHEL Raspbian S3 +SBOMs? SLES +SLSA +SPDX SQLite Slack Snyk diff --git a/Gemfile b/Gemfile index 6ac458fb5c..72c950d75a 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,7 @@ end gem 'rouge', '3.27.0' gem 'front_matter_parser', '1.0.1' -gem 'git', '1.12.0' +gem 'git', '1.13.0' gem 'html-proofer', '3.19.4' gem 'mdl', '0.11.0' gem 'octopress-hooks', '2.6.2' diff --git a/Gemfile.lock b/Gemfile.lock index 2a3593fcfc..6bdce6a01a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -16,7 +16,7 @@ GEM ffi (1.15.5) forwardable-extended (2.6.0) front_matter_parser (1.0.1) - git (1.12.0) + git (1.13.0) addressable (~> 2.8) rchardet (~> 1.8) html-proofer (3.19.4) @@ -88,7 +88,7 @@ GEM parallel (1.22.1) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (5.0.0) + public_suffix (5.0.1) racc (1.6.1) rainbow (3.1.1) rake (13.0.6) @@ -116,7 +116,7 @@ PLATFORMS DEPENDENCIES front_matter_parser (= 1.0.1) - git (= 1.12.0) + git (= 1.13.0) html-proofer (= 3.19.4) jekyll (= 4.2.2) jekyll-redirect-from diff --git a/_config.yml b/_config.yml index 313b83bdd2..e96dbac572 100644 --- a/_config.yml +++ b/_config.yml @@ -45,7 +45,7 @@ exclude: latest_engine_api_version: "1.41" docker_ce_version: "20.10" compose_v1_version: "1.29.2" -compose_version: "v2.14.2" +compose_version: "v2.15.1" compose_file_v3: "3.9" compose_file_v2: "2.4" machine_version: "0.16.0" @@ -171,7 +171,12 @@ fetch-remote: - repo: "https://github.com/docker/docker" default_branch: "master" - ref: "20.10" + # The default branch has separate files for each API version, so we can + # consume the swagger files from that branch (we only publish the ones + # that have been released through the stubs in the engine/api/ directory). + # Using the default (master) branch allows for API docs changes to be + # published without them being cherry-picked into the release branch. + ref: "master" paths: - dest: "engine/api" src: @@ -209,3 +214,9 @@ fetch-remote: - dest: "build/buildkit/toml-configuration.md" src: - "docs/buildkitd.toml.md" + - dest: "build/attestations/slsa-definitions.md" + src: + - "docs/attestations/slsa-definitions.md" + - dest: "build/attestations/attestation-storage.md" + src: + - "docs/attestations/attestation-storage.md" diff --git a/_data/buildx/docker_buildx_bake.yaml b/_data/buildx/docker_buildx_bake.yaml index af05e9180b..584f974df4 100644 --- a/_data/buildx/docker_buildx_bake.yaml +++ b/_data/buildx/docker_buildx_bake.yaml @@ -82,6 +82,16 @@ options: experimentalcli: false kubernetes: false swarm: false + - option: provenance + value_type: string + description: Shorthand for `--set=*.attest=type=provenance` + details_url: '#provenance' + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: pull value_type: bool default_value: "false" @@ -103,6 +113,16 @@ options: experimentalcli: false kubernetes: false swarm: false + - option: sbom + value_type: string + description: Shorthand for `--set=*.attest=type=sbom` + details_url: '#sbom' + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: set value_type: stringArray default_value: '[]' @@ -204,10 +224,18 @@ examples: |- Same as [`build --progress`](buildx_build.md#progress). + ### Create provenance attestations (--provenance) {#provenance} + + Same as [`build --provenance`](buildx_build.md#provenance). + ### Always attempt to pull a newer version of the image (--pull) {#pull} Same as `build --pull`. + ### Create SBOM attestations (--sbom) {#sbom} + + Same as [`build --sbom`](buildx_build.md#sbom). + ### Override target configurations from command line (--set) {#set} ``` diff --git a/_data/buildx/docker_buildx_build.yaml b/_data/buildx/docker_buildx_build.yaml index d97e90fb6f..964edce353 100644 --- a/_data/buildx/docker_buildx_build.yaml +++ b/_data/buildx/docker_buildx_build.yaml @@ -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 @@ -35,6 +35,17 @@ options: experimentalcli: false kubernetes: false swarm: false + - option: attest + value_type: stringArray + default_value: '[]' + description: 'Attestation parameters (format: `type=sbom,generator=image`)' + details_url: '#attest' + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: build-arg value_type: stringArray default_value: '[]' @@ -84,7 +95,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 @@ -154,7 +165,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 @@ -324,6 +335,16 @@ options: experimentalcli: false kubernetes: false swarm: false + - option: provenance + value_type: string + description: Shortand for `--attest=type=provenance` + details_url: '#provenance' + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: pull value_type: bool default_value: "false" @@ -366,6 +387,16 @@ options: experimentalcli: false kubernetes: false swarm: false + - option: sbom + value_type: string + description: Shorthand for `--attest=type=sbom` + details_url: '#sbom' + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: secret value_type: stringArray default_value: '[]' @@ -426,7 +457,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 @@ -436,7 +467,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 @@ -466,6 +497,30 @@ inherited_options: kubernetes: false swarm: false examples: |- + ### Create attestations (--attest) {#attest} + + ``` + --attest=type=sbom,... + --attest=type=provenance,... + ``` + + Create [image attestations](/build/attestations/). + BuildKit currently supports: + + - `sbom` - Software Bill of Materials. + + Use `--attest=type=sbom` to generate an SBOM for an image at build-time. + Alternatively, you can use the [`--sbom` shorthand](#sbom). + + For more information, see [here](/build/attestations/sbom/). + + - `provenance` - SLSA Provenance + + Use `--attest=type=provenance` to generate provenance for an image at + build-time. Alternatively, you can use the [`--provenance` shorthand](#provenance). + + For more information, see [here](/build/attestations/slsa-provenance/). + ### Allow extra privileged entitlement (--allow) {#allow} ``` @@ -490,7 +545,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: @@ -531,36 +586,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: + $ docker buildx build --build-context foo=oci-layout:///path/to/local/layout@sha256: ``` - ```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: `=oci-layout://@sha256:`, 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} @@ -573,7 +625,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 @@ -583,6 +635,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. @@ -594,6 +649,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 @@ -605,15 +661,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 @@ -631,6 +689,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 @@ -847,11 +906,21 @@ examples: |- > Check also our [Color output controls guide](https://github.com/docker/buildx/blob/master/docs/guides/color-output.md) > for modifying the colors that are used to output information to the terminal. + ### Create provenance attestations (--provenance) {#provenance} + + Shorthand for [`--attest=type=provenance`](#attest). Enables provenance + attestations for the build result. + ### Push the build result to a registry (--push) {#push} Shorthand for [`--output=type=registry`](#registry). Will automatically push the build result to registry. + ### Create SBOM attestations (--sbom) {#sbom} + + Shorthand for [`--attest=type=sbom`](#attest). Enables SBOM attestations for + the build result. + ### Secret to expose to the build (--secret) {#secret} ``` @@ -871,7 +940,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 \ @@ -890,7 +959,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 \ @@ -922,7 +991,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 diff --git a/_data/buildx/docker_buildx_create.yaml b/_data/buildx/docker_buildx_create.yaml index d4b5392a29..34065598c4 100644 --- a/_data/buildx/docker_buildx_create.yaml +++ b/_data/buildx/docker_buildx_create.yaml @@ -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 @@ -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} diff --git a/_data/buildx/docker_buildx_imagetools_inspect.yaml b/_data/buildx/docker_buildx_imagetools_inspect.yaml index 2e2a02e2e6..d7ebf80dd2 100644 --- a/_data/buildx/docker_buildx_imagetools_inspect.yaml +++ b/_data/buildx/docker_buildx_imagetools_inspect.yaml @@ -88,7 +88,6 @@ examples: |- * `.Name`: provides the reference of the image * `.Manifest`: provides the manifest or manifest list * `.Image`: provides the image config - * `.BuildInfo`: provides [build info from image config](https://github.com/moby/buildkit/blob/master/docs/build-repro.md#image-config) #### `.Name` @@ -138,39 +137,6 @@ examples: |- Platform: linux/riscv64 ``` - #### `.BuildInfo` - - ```console - $ docker buildx imagetools inspect crazymax/buildx:buildinfo --format "{{.BuildInfo}}" - Name: docker.io/crazymax/buildx:buildinfo - Frontend: dockerfile.v0 - Attrs: - filename: Dockerfile - source: docker/dockerfile-upstream:master-labs - build-arg:bar: foo - build-arg:foo: bar - Sources: - Type: docker-image - Ref: docker.io/docker/buildx-bin:0.6.1@sha256:a652ced4a4141977c7daaed0a074dcd9844a78d7d2615465b12f433ae6dd29f0 - Pin: sha256:a652ced4a4141977c7daaed0a074dcd9844a78d7d2615465b12f433ae6dd29f0 - - Type: docker-image - Ref: docker.io/library/alpine:3.13 - Pin: sha256:026f721af4cf2843e07bba648e158fb35ecc876d822130633cc49f707f0fc88c - - Type: docker-image - Ref: docker.io/moby/buildkit:v0.9.0 - Pin: sha256:8dc668e7f66db1c044aadbed306020743516a94848793e0f81f94a087ee78cab - - Type: docker-image - Ref: docker.io/tonistiigi/xx@sha256:21a61be4744f6531cb5f33b0e6f40ede41fa3a1b8c82d5946178f80cc84bfc04 - Pin: sha256:21a61be4744f6531cb5f33b0e6f40ede41fa3a1b8c82d5946178f80cc84bfc04 - - Type: http - Ref: https://raw.githubusercontent.com/moby/moby/master/README.md - Pin: sha256:419455202b0ef97e480d7f8199b26a721a417818bc0e2d106975f74323f25e6c - ``` - #### JSON output A `json` go template func is also available if you want to render fields as @@ -182,7 +148,7 @@ examples: |- ```json { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", - "digest": "sha256:08602e7340970e92bde5e0a2e887c1fde4d9ae753d1e05efb4c8ef3b609f97f1", + "digest": "sha256:a9ca35b798e0b198f9be7f3b8b53982e9a6cf96814cb10d78083f40ad8c127f1", "size": 949 } ``` @@ -193,23 +159,23 @@ examples: |- ```json { "schemaVersion": 2, - "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", - "digest": "sha256:79d97f205e2799d99a3a8ae2a1ef17acb331e11784262c3faada847dc6972c52", - "size": 2010, + "mediaType": "application/vnd.oci.image.index.v1+json", + "digest": "sha256:d895e8fdcf5e2bb39acb5966f97fc4cd87a2d13d27c939c320025eb4aca5440c", + "size": 4654, "manifests": [ { - "mediaType": "application/vnd.docker.distribution.manifest.v2+json", - "digest": "sha256:bd1e78f06de26610fadf4eb9d04b1a45a545799d6342701726e952cc0c11c912", - "size": 1158, + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:ac9dd4fbec9e36b562f910618975a2936533f8e411a3fea2858aacc0ac972e1c", + "size": 1054, "platform": { "architecture": "amd64", "os": "linux" } }, { - "mediaType": "application/vnd.docker.distribution.manifest.v2+json", - "digest": "sha256:d37dcced63ec0965824fca644f0ac9efad8569434ec15b4c83adfcb3dcfc743b", - "size": 1158, + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:0f4dc6797db467372cbf52c7236816203654a839f64a6542c9135d1973c9d744", + "size": 1054, "platform": { "architecture": "arm", "os": "linux", @@ -217,260 +183,356 @@ examples: |- } }, { - "mediaType": "application/vnd.docker.distribution.manifest.v2+json", - "digest": "sha256:ce142eb2255e6af46f2809e159fd03081697c7605a3de03b9cbe9a52ddb244bf", - "size": 1158, + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:d62bb533d95afe17c4a9caf1e7c57a3b0a7a67409ccfa7af947aeb0f670ffb87", + "size": 1054, "platform": { "architecture": "arm64", "os": "linux" } }, { - "mediaType": "application/vnd.docker.distribution.manifest.v2+json", - "digest": "sha256:f59bfb5062fff76ce464bfa4e25ebaaaac887d6818238e119d68613c456d360c", - "size": 1158, + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:b4944057e0c68203cdcc3dceff3b2df3c7d9e3dd801724fa977b01081da7771e", + "size": 1054, "platform": { "architecture": "s390x", "os": "linux" } }, { - "mediaType": "application/vnd.docker.distribution.manifest.v2+json", - "digest": "sha256:cc96426e0c50a78105d5637d31356db5dd6ec594f21b24276e534a32da09645c", - "size": 1159, + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:825702a51eb4234904fc9253d8b0bf0a584787ffd8fc3fd6fa374188233ce399", + "size": 1054, "platform": { "architecture": "ppc64le", "os": "linux" } }, { - "mediaType": "application/vnd.docker.distribution.manifest.v2+json", - "digest": "sha256:39f9c1e2878e6c333acb23187d6b205ce82ed934c60da326cb2c698192631478", - "size": 1158, + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:dfb27c6acc9b9f3a7c9d47366d137089565062f43c8063c9f5e408d34c87ee4a", + "size": 1054, "platform": { "architecture": "riscv64", "os": "linux" } + }, + { + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:f2fe69bccc878e658caf21dfc99eaf726fb20d28f17398c1d66a90e62cc019f9", + "size": 1113, + "annotations": { + "vnd.docker.reference.digest": "sha256:ac9dd4fbec9e36b562f910618975a2936533f8e411a3fea2858aacc0ac972e1c", + "vnd.docker.reference.type": "attestation-manifest" + }, + "platform": { + "architecture": "unknown", + "os": "unknown" + } + }, + { + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:9e112f8d4e383186f36369fba7b454e246d2e9ca5def797f1b84ede265e9f3ca", + "size": 1113, + "annotations": { + "vnd.docker.reference.digest": "sha256:0f4dc6797db467372cbf52c7236816203654a839f64a6542c9135d1973c9d744", + "vnd.docker.reference.type": "attestation-manifest" + }, + "platform": { + "architecture": "unknown", + "os": "unknown" + } + }, + { + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:09d593587f8665269ec6753eaed7fbdb09968f71587dd53e06519502cbc16775", + "size": 1113, + "annotations": { + "vnd.docker.reference.digest": "sha256:d62bb533d95afe17c4a9caf1e7c57a3b0a7a67409ccfa7af947aeb0f670ffb87", + "vnd.docker.reference.type": "attestation-manifest" + }, + "platform": { + "architecture": "unknown", + "os": "unknown" + } + }, + { + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:985a3f4544dfb042db6a8703f5f76438667dd7958aba14cb04bebe3b4cbd9307", + "size": 1113, + "annotations": { + "vnd.docker.reference.digest": "sha256:b4944057e0c68203cdcc3dceff3b2df3c7d9e3dd801724fa977b01081da7771e", + "vnd.docker.reference.type": "attestation-manifest" + }, + "platform": { + "architecture": "unknown", + "os": "unknown" + } + }, + { + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:cfccb6afeede7dc29bf8abef4815d56f2723fa482ea63c9cd519cd991c379294", + "size": 1113, + "annotations": { + "vnd.docker.reference.digest": "sha256:825702a51eb4234904fc9253d8b0bf0a584787ffd8fc3fd6fa374188233ce399", + "vnd.docker.reference.type": "attestation-manifest" + }, + "platform": { + "architecture": "unknown", + "os": "unknown" + } + }, + { + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:2e93733432c6a14cb57db33928b3a17d7ca298b3babe24d9f56dca2754dbde3b", + "size": 1113, + "annotations": { + "vnd.docker.reference.digest": "sha256:dfb27c6acc9b9f3a7c9d47366d137089565062f43c8063c9f5e408d34c87ee4a", + "vnd.docker.reference.type": "attestation-manifest" + }, + "platform": { + "architecture": "unknown", + "os": "unknown" + } } ] } ``` + Following command provides [SLSA](https://github.com/moby/buildkit/blob/master/docs/attestations/slsa-provenance.md) JSON output: + ```console - $ docker buildx imagetools inspect crazymax/buildx:buildinfo --format "{{json .BuildInfo}}" + $ docker buildx imagetools inspect crazymax/buildkit:attest --format "{{json .Provenance}}" ``` ```json { - "frontend": "dockerfile.v0", - "attrs": { - "build-arg:bar": "foo", - "build-arg:foo": "bar", - "filename": "Dockerfile", - "source": "crazymax/dockerfile:buildattrs" - }, - "sources": [ - { - "type": "docker-image", - "ref": "docker.io/docker/buildx-bin:0.6.1@sha256:a652ced4a4141977c7daaed0a074dcd9844a78d7d2615465b12f433ae6dd29f0", - "pin": "sha256:a652ced4a4141977c7daaed0a074dcd9844a78d7d2615465b12f433ae6dd29f0" + "SLSA": { + "builder": { + "id": "" }, - { - "type": "docker-image", - "ref": "docker.io/library/alpine:3.13@sha256:026f721af4cf2843e07bba648e158fb35ecc876d822130633cc49f707f0fc88c", - "pin": "sha256:026f721af4cf2843e07bba648e158fb35ecc876d822130633cc49f707f0fc88c" + "buildType": "https://mobyproject.org/buildkit@v1", + "materials": [ + { + "uri": "pkg:docker/docker/buildkit-syft-scanner@stable-1", + "digest": { + "sha256": "b45f1d207e16c3a3a5a10b254ad8ad358d01f7ea090d382b95c6b2ee2b3ef765" + } + }, + { + "uri": "pkg:docker/alpine@latest?platform=linux%2Famd64", + "digest": { + "sha256": "8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4" + } + } + ], + "invocation": { + "configSource": {}, + "parameters": { + "frontend": "dockerfile.v0", + "locals": [ + { + "name": "context" + }, + { + "name": "dockerfile" + } + ] + }, + "environment": { + "platform": "linux/amd64" + } }, - { - "type": "docker-image", - "ref": "docker.io/moby/buildkit:v0.9.0@sha256:8dc668e7f66db1c044aadbed306020743516a94848793e0f81f94a087ee78cab", - "pin": "sha256:8dc668e7f66db1c044aadbed306020743516a94848793e0f81f94a087ee78cab" - }, - { - "type": "docker-image", - "ref": "docker.io/tonistiigi/xx@sha256:21a61be4744f6531cb5f33b0e6f40ede41fa3a1b8c82d5946178f80cc84bfc04", - "pin": "sha256:21a61be4744f6531cb5f33b0e6f40ede41fa3a1b8c82d5946178f80cc84bfc04" - }, - { - "type": "http", - "ref": "https://raw.githubusercontent.com/moby/moby/master/README.md", - "pin": "sha256:419455202b0ef97e480d7f8199b26a721a417818bc0e2d106975f74323f25e6c" + "metadata": { + "buildInvocationID": "02tdha2xkbxvin87mz9drhag4", + "buildStartedOn": "2022-12-01T11:50:07.264704131Z", + "buildFinishedOn": "2022-12-01T11:50:08.243788739Z", + "reproducible": false, + "completeness": { + "parameters": true, + "environment": true, + "materials": false + }, + "https://mobyproject.org/buildkit@v1#metadata": {} } - ] + } + } + ``` + + Following command provides [SBOM](https://github.com/moby/buildkit/blob/master/docs/attestations/sbom.md) JSON output: + + ```console + $ docker buildx imagetools inspect crazymax/buildkit:attest --format "{{json .SBOM}}" + ``` + ```json + { + "SPDX": { + "SPDXID": "SPDXRef-DOCUMENT", + "creationInfo": { + "created": "2022-12-01T11:46:48.063400162Z", + "creators": [ + "Tool: syft-v0.60.3", + "Tool: buildkit-1ace2bb", + "Organization: Anchore, Inc" + ], + "licenseListVersion": "3.18" + }, + "dataLicense": "CC0-1.0", + "documentNamespace": "https://anchore.com/syft/dir/run/src/core-0a4ccc6d-1a72-4c3a-a40e-3df1a2ffca94", + "files": [...], + "spdxVersion": "SPDX-2.2" + } } ``` ```console - $ docker buildx imagetools inspect crazymax/buildx:buildinfo --format "{{json .}}" + $ docker buildx imagetools inspect crazymax/buildkit:attest --format "{{json .}}" ``` ```json { - "name": "crazymax/buildx:buildinfo", + "name": "crazymax/buildkit:attest", "manifest": { - "mediaType": "application/vnd.docker.distribution.manifest.v2+json", - "digest": "sha256:899d2c7acbc124d406820857bb51d9089717bbe4e22b97eb4bc5789e99f09f83", - "size": 2628 + "schemaVersion": 2, + "mediaType": "application/vnd.oci.image.index.v1+json", + "digest": "sha256:7007b387ccd52bd42a050f2e8020e56e64622c9269bf7bbe257b326fe99daf19", + "size": 855, + "manifests": [ + { + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:fbd10fe50b4b174bb9ea273e2eb9827fa8bf5c88edd8635a93dc83e0d1aecb55", + "size": 673, + "platform": { + "architecture": "amd64", + "os": "linux" + } + }, + { + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:a9de632c16998489fd63fbca42a03431df00639cfb2ecb8982bf9984b83c5b2b", + "size": 839, + "annotations": { + "vnd.docker.reference.digest": "sha256:fbd10fe50b4b174bb9ea273e2eb9827fa8bf5c88edd8635a93dc83e0d1aecb55", + "vnd.docker.reference.type": "attestation-manifest" + }, + "platform": { + "architecture": "unknown", + "os": "unknown" + } + } + ] }, "image": { - "created": "2022-02-24T12:27:43.627154558Z", + "created": "2022-12-01T11:46:47.713777178Z", "architecture": "amd64", "os": "linux", "config": { "Env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - "DOCKER_TLS_CERTDIR=/certs", - "DOCKER_CLI_EXPERIMENTAL=enabled" - ], - "Entrypoint": [ - "docker-entrypoint.sh" + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ], "Cmd": [ - "sh" + "/bin/sh" ] }, "rootfs": { "type": "layers", "diff_ids": [ - "sha256:7fcb75871b2101082203959c83514ac8a9f4ecfee77a0fe9aa73bbe56afdf1b4", - "sha256:d3c0b963ff5684160641f936d6a4aa14efc8ff27b6edac255c07f2d03ff92e82", - "sha256:3f8d78f13fa9b1f35d3bc3f1351d03a027c38018c37baca73f93eecdea17f244", - "sha256:8e6eb1137b182ae0c3f5d40ca46341fda2eaeeeb5fa516a9a2bf96171238e2e0", - "sha256:fde4c869a56b54dd76d7352ddaa813fd96202bda30b9dceb2c2f2ad22fa2e6ce", - "sha256:52025823edb284321af7846419899234b3c66219bf06061692b709875ed0760f", - "sha256:50adb5982dbf6126c7cf279ac3181d1e39fc9116b610b947a3dadae6f7e7c5bc", - "sha256:9801c319e1c66c5d295e78b2d3e80547e73c7e3c63a4b71e97c8ca357224af24", - "sha256:dfbfac44d5d228c49b42194c8a2f470abd6916d072f612a6fb14318e94fde8ae", - "sha256:3dfb74e19dedf61568b917c19b0fd3ee4580870027ca0b6054baf239855d1322", - "sha256:b182e707c23e4f19be73f9022a99d2d1ca7bf1ca8f280d40e4d1c10a6f51550e" + "sha256:ded7a220bb058e28ee3254fbba04ca90b679070424424761a53a043b93b612bf", + "sha256:d85d09ab4b4e921666ccc2db8532e857bf3476b7588e52c9c17741d7af14204f" ] }, "history": [ { - "created": "2021-11-12T17:19:58.698676655Z", - "created_by": "/bin/sh -c #(nop) ADD file:5a707b9d6cb5fff532e4c2141bc35707593f21da5528c9e71ae2ddb6ba4a4eb6 in / " + "created": "2022-11-22T22:19:28.870801855Z", + "created_by": "/bin/sh -c #(nop) ADD file:587cae71969871d3c6456d844a8795df9b64b12c710c275295a1182b46f630e7 in / " }, { - "created": "2021-11-12T17:19:58.948920855Z", + "created": "2022-11-22T22:19:29.008562326Z", "created_by": "/bin/sh -c #(nop) CMD [\"/bin/sh\"]", "empty_layer": true }, { - "created": "2022-02-24T12:27:38.285594601Z", - "created_by": "RUN /bin/sh -c apk --update --no-cache add bash ca-certificates openssh-client \u0026\u0026 rm -rf /tmp/* /var/cache/apk/* # buildkit", + "created": "2022-12-01T11:46:47.713777178Z", + "created_by": "RUN /bin/sh -c apk add curl # buildkit", "comment": "buildkit.dockerfile.v0" - }, - { - "created": "2022-02-24T12:27:41.061874167Z", - "created_by": "COPY /opt/docker/ /usr/local/bin/ # buildkit", - "comment": "buildkit.dockerfile.v0" - }, - { - "created": "2022-02-24T12:27:41.174098947Z", - "created_by": "COPY /usr/bin/buildctl /usr/local/bin/buildctl # buildkit", - "comment": "buildkit.dockerfile.v0" - }, - { - "created": "2022-02-24T12:27:41.320343683Z", - "created_by": "COPY /usr/bin/buildkit* /usr/local/bin/ # buildkit", - "comment": "buildkit.dockerfile.v0" - }, - { - "created": "2022-02-24T12:27:41.447149933Z", - "created_by": "COPY /buildx /usr/libexec/docker/cli-plugins/docker-buildx # buildkit", - "comment": "buildkit.dockerfile.v0" - }, - { - "created": "2022-02-24T12:27:43.057722191Z", - "created_by": "COPY /opt/docker-compose /usr/libexec/docker/cli-plugins/docker-compose # buildkit", - "comment": "buildkit.dockerfile.v0" - }, - { - "created": "2022-02-24T12:27:43.145224134Z", - "created_by": "ADD https://raw.githubusercontent.com/moby/moby/master/README.md / # buildkit", - "comment": "buildkit.dockerfile.v0" - }, - { - "created": "2022-02-24T12:27:43.422212427Z", - "created_by": "ENV DOCKER_TLS_CERTDIR=/certs", - "comment": "buildkit.dockerfile.v0", - "empty_layer": true - }, - { - "created": "2022-02-24T12:27:43.422212427Z", - "created_by": "ENV DOCKER_CLI_EXPERIMENTAL=enabled", - "comment": "buildkit.dockerfile.v0", - "empty_layer": true - }, - { - "created": "2022-02-24T12:27:43.422212427Z", - "created_by": "RUN /bin/sh -c docker --version \u0026\u0026 buildkitd --version \u0026\u0026 buildctl --version \u0026\u0026 docker buildx version \u0026\u0026 docker compose version \u0026\u0026 mkdir /certs /certs/client \u0026\u0026 chmod 1777 /certs /certs/client # buildkit", - "comment": "buildkit.dockerfile.v0" - }, - { - "created": "2022-02-24T12:27:43.514320155Z", - "created_by": "COPY rootfs/modprobe.sh /usr/local/bin/modprobe # buildkit", - "comment": "buildkit.dockerfile.v0" - }, - { - "created": "2022-02-24T12:27:43.627154558Z", - "created_by": "COPY rootfs/docker-entrypoint.sh /usr/local/bin/ # buildkit", - "comment": "buildkit.dockerfile.v0" - }, - { - "created": "2022-02-24T12:27:43.627154558Z", - "created_by": "ENTRYPOINT [\"docker-entrypoint.sh\"]", - "comment": "buildkit.dockerfile.v0", - "empty_layer": true - }, - { - "created": "2022-02-24T12:27:43.627154558Z", - "created_by": "CMD [\"sh\"]", - "comment": "buildkit.dockerfile.v0", - "empty_layer": true } ] }, - "buildinfo": { - "frontend": "dockerfile.v0", - "attrs": { - "build-arg:bar": "foo", - "build-arg:foo": "bar", - "filename": "Dockerfile", - "source": "docker/dockerfile-upstream:master-labs" - }, - "sources": [ - { - "type": "docker-image", - "ref": "docker.io/docker/buildx-bin:0.6.1@sha256:a652ced4a4141977c7daaed0a074dcd9844a78d7d2615465b12f433ae6dd29f0", - "pin": "sha256:a652ced4a4141977c7daaed0a074dcd9844a78d7d2615465b12f433ae6dd29f0" + "Provenance": { + "SLSA": { + "builder": { + "id": "" }, - { - "type": "docker-image", - "ref": "docker.io/library/alpine:3.13", - "pin": "sha256:026f721af4cf2843e07bba648e158fb35ecc876d822130633cc49f707f0fc88c" + "buildType": "https://mobyproject.org/buildkit@v1", + "materials": [ + { + "uri": "pkg:docker/docker/buildkit-syft-scanner@stable-1", + "digest": { + "sha256": "b45f1d207e16c3a3a5a10b254ad8ad358d01f7ea090d382b95c6b2ee2b3ef765" + } + }, + { + "uri": "pkg:docker/alpine@latest?platform=linux%2Famd64", + "digest": { + "sha256": "8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4" + } + } + ], + "invocation": { + "configSource": {}, + "parameters": { + "frontend": "dockerfile.v0", + "locals": [ + { + "name": "context" + }, + { + "name": "dockerfile" + } + ] + }, + "environment": { + "platform": "linux/amd64" + } }, - { - "type": "docker-image", - "ref": "docker.io/moby/buildkit:v0.9.0", - "pin": "sha256:8dc668e7f66db1c044aadbed306020743516a94848793e0f81f94a087ee78cab" - }, - { - "type": "docker-image", - "ref": "docker.io/tonistiigi/xx@sha256:21a61be4744f6531cb5f33b0e6f40ede41fa3a1b8c82d5946178f80cc84bfc04", - "pin": "sha256:21a61be4744f6531cb5f33b0e6f40ede41fa3a1b8c82d5946178f80cc84bfc04" - }, - { - "type": "http", - "ref": "https://raw.githubusercontent.com/moby/moby/master/README.md", - "pin": "sha256:419455202b0ef97e480d7f8199b26a721a417818bc0e2d106975f74323f25e6c" + "metadata": { + "buildInvocationID": "02tdha2xkbxvin87mz9drhag4", + "buildStartedOn": "2022-12-01T11:50:07.264704131Z", + "buildFinishedOn": "2022-12-01T11:50:08.243788739Z", + "reproducible": false, + "completeness": { + "parameters": true, + "environment": true, + "materials": false + }, + "https://mobyproject.org/buildkit@v1#metadata": {} } - ] + } + }, + "SBOM": { + "SPDX": { + "SPDXID": "SPDXRef-DOCUMENT", + "creationInfo": { + "created": "2022-12-01T11:46:48.063400162Z", + "creators": [ + "Tool: syft-v0.60.3", + "Tool: buildkit-1ace2bb", + "Organization: Anchore, Inc" + ], + "licenseListVersion": "3.18" + }, + "dataLicense": "CC0-1.0", + "documentNamespace": "https://anchore.com/syft/dir/run/src/core-0a4ccc6d-1a72-4c3a-a40e-3df1a2ffca94", + "files": [...], + "spdxVersion": "SPDX-2.2" + } } } ``` #### Multi-platform - Multi-platform images are supported for `.Image` and `.BuildInfo` fields. If - you want to pick up a specific platform, you can specify it using the `index` + Multi-platform images are supported for `.Image`, `.SLSA` and `.SBOM` fields. + If you want to pick up a specific platform, you can specify it using the `index` go template function: ```console @@ -478,7 +540,7 @@ examples: |- ``` ```json { - "created": "2022-02-25T17:13:27.89891722Z", + "created": "2022-11-30T17:42:26.414957336Z", "architecture": "s390x", "os": "linux", "config": { @@ -497,8 +559,8 @@ examples: |- "diff_ids": [ "sha256:41048e32d0684349141cf05f629c5fc3c5915d1f3426b66dbb8953a540e01e1e", "sha256:2651209b9208fff6c053bc3c17353cb07874e50f1a9bc96d6afd03aef63de76a", - "sha256:6741ed7e73039d853fa8902246a4c7e8bf9dd09652fd1b08251bc5f9e8876a7f", - "sha256:92ac046adeeb65c86ae3f0b458dee04ad4a462e417661c04d77642c66494f69b" + "sha256:88577322e65f094ce8ac27435880f1a8a9baadb569258026bb141770451bafcb", + "sha256:de8f9a790e4ed10ff1f1f8ea923c9da4f97246a7e200add2dc6650eba3f10a20" ] }, "history": [ @@ -517,23 +579,23 @@ examples: |- "comment": "buildkit.dockerfile.v0" }, { - "created": "2022-02-24T00:34:00.924540012Z", + "created": "2022-08-25T00:39:25.652811078Z", "created_by": "COPY examples/buildctl-daemonless/buildctl-daemonless.sh /usr/bin/ # buildkit", "comment": "buildkit.dockerfile.v0" }, { - "created": "2022-02-25T17:13:27.89891722Z", + "created": "2022-11-30T17:42:26.414957336Z", "created_by": "VOLUME [/var/lib/buildkit]", "comment": "buildkit.dockerfile.v0", "empty_layer": true }, { - "created": "2022-02-25T17:13:27.89891722Z", + "created": "2022-11-30T17:42:26.414957336Z", "created_by": "COPY / /usr/bin/ # buildkit", "comment": "buildkit.dockerfile.v0" }, { - "created": "2022-02-25T17:13:27.89891722Z", + "created": "2022-11-30T17:42:26.414957336Z", "created_by": "ENTRYPOINT [\"buildkitd\"]", "comment": "buildkit.dockerfile.v0", "empty_layer": true @@ -557,24 +619,24 @@ examples: |- "schemaVersion": 2, "config": { "mediaType": "application/vnd.docker.container.image.v1+json", - "digest": "sha256:7ace7d324e79b360b2db8b820d83081863d96d22e734cdf297a8e7fd83f6ceb3", - "size": 2298 + "digest": "sha256:a98999183d2c7a8845f6d56496e51099ce6e4359ee7255504174b05430c4b78b", + "size": 2762 }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", - "digest": "sha256:5843afab387455b37944e709ee8c78d7520df80f8d01cf7f861aae63beeddb6b", - "size": 2811478 + "digest": "sha256:8663204ce13b2961da55026a2034abb9e5afaaccf6a9cfb44ad71406dcd07c7b", + "size": 2818370 }, { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", - "digest": "sha256:726d3732a87e1c430d67e8969de6b222a889d45e045ebae1a008a37ba38f3b1f", - "size": 1776812 + "digest": "sha256:f0868a92f8e1e5018ed4e60eb845ed4ff0e2229897f4105e5a4735c1d6fd874f", + "size": 1821402 }, { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", - "digest": "sha256:5d7cf9b33148a8f220c84f27dd2cfae46aca019a3ea3fbf7274f6d6dbfae8f3b", - "size": 382855 + "digest": "sha256:d010066dbdfcf7c12fca30cd4b567aa7218eb6762ab53169d043655b7a8d7f2e", + "size": 404457 } ] } @@ -590,7 +652,7 @@ examples: |- "manifests": [ { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", - "digest": "sha256:667d28c9fb33820ce686887a717a148e89fa77f9097f9352996bbcce99d352b1", + "digest": "sha256:f9f41c85124686c2afe330a985066748a91d7a5d505777fe274df804ab5e077e", "size": 1158, "platform": { "architecture": "amd64", @@ -599,7 +661,7 @@ examples: |- }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", - "digest": "sha256:71789527b64ab3d7b3de01d364b449cd7f7a3da758218fbf73b9c9aae05a6775", + "digest": "sha256:82097c2be19c617aafb3c3e43c88548738d4b2bf3db5c36666283a918b390266", "size": 1158, "platform": { "architecture": "arm", @@ -609,7 +671,7 @@ examples: |- }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", - "digest": "sha256:fb64667e1ce6ab0d05478f3a8402af07b27737598dcf9a510fb1d792b13a66be", + "digest": "sha256:b6b91e6c823d7220ded7d3b688e571ba800b13d91bbc904c1d8053593e3ee42c", "size": 1158, "platform": { "architecture": "arm64", @@ -618,7 +680,7 @@ examples: |- }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", - "digest": "sha256:1c3ddf95a0788e23f72f25800c05abc4458946685e2b66788c3d978cde6da92b", + "digest": "sha256:797061bcc16778de048b96f769c018ec24da221088050bbe926ea3b8d51d77e8", "size": 1158, "platform": { "architecture": "s390x", @@ -627,7 +689,7 @@ examples: |- }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", - "digest": "sha256:05bcde6d460a284e5bc88026cd070277e8380355de3126cbc8fe8a452708c6b1", + "digest": "sha256:b93d3a84d18c4d0b8c279e77343d854d9b5177df7ea55cf468d461aa2523364e", "size": 1159, "platform": { "architecture": "ppc64le", @@ -636,7 +698,7 @@ examples: |- }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", - "digest": "sha256:c04c57765304ab84f4f9807fff3e11605c3a60e16435c734b02c723680f6bd6e", + "digest": "sha256:d5c950dd1b270d437c838187112a0cb44c9258248d7a3a8bcb42fae8f717dc01", "size": 1158, "platform": { "architecture": "riscv64", diff --git a/_data/buildx/docker_buildx_install.yaml b/_data/buildx/docker_buildx_install.yaml index 4e8ed387ef..9fe42f0919 100644 --- a/_data/buildx/docker_buildx_install.yaml +++ b/_data/buildx/docker_buildx_install.yaml @@ -4,12 +4,11 @@ long: Install buildx as a 'docker builder' alias usage: docker buildx install pname: docker buildx plink: docker_buildx.yaml -inherited_options: +options: - option: builder value_type: string - description: Override the configured builder instance deprecated: false - hidden: false + hidden: true experimental: false experimentalcli: false kubernetes: false diff --git a/_data/buildx/docker_buildx_ls.yaml b/_data/buildx/docker_buildx_ls.yaml index 00b3514b28..d78d5d38eb 100644 --- a/_data/buildx/docker_buildx_ls.yaml +++ b/_data/buildx/docker_buildx_ls.yaml @@ -19,12 +19,11 @@ long: |- usage: docker buildx ls pname: docker buildx plink: docker_buildx.yaml -inherited_options: +options: - option: builder value_type: string - description: Override the configured builder instance deprecated: false - hidden: false + hidden: true experimental: false experimentalcli: false kubernetes: false diff --git a/_data/buildx/docker_buildx_uninstall.yaml b/_data/buildx/docker_buildx_uninstall.yaml index 6a45c6c5be..b497999ad0 100644 --- a/_data/buildx/docker_buildx_uninstall.yaml +++ b/_data/buildx/docker_buildx_uninstall.yaml @@ -4,12 +4,11 @@ long: Uninstall the 'docker builder' alias usage: docker buildx uninstall pname: docker buildx plink: docker_buildx.yaml -inherited_options: +options: - option: builder value_type: string - description: Override the configured builder instance deprecated: false - hidden: false + hidden: true experimental: false experimentalcli: false kubernetes: false diff --git a/_data/buildx/docker_buildx_version.yaml b/_data/buildx/docker_buildx_version.yaml index 2e2abfa487..d6619459e4 100644 --- a/_data/buildx/docker_buildx_version.yaml +++ b/_data/buildx/docker_buildx_version.yaml @@ -10,12 +10,11 @@ long: |- usage: docker buildx version pname: docker buildx plink: docker_buildx.yaml -inherited_options: +options: - option: builder value_type: string - description: Override the configured builder instance deprecated: false - hidden: false + hidden: true experimental: false experimentalcli: false kubernetes: false diff --git a/_data/compose-cli/docker_compose_pull.yaml b/_data/compose-cli/docker_compose_pull.yaml index a06e8387fe..c07afde137 100644 --- a/_data/compose-cli/docker_compose_pull.yaml +++ b/_data/compose-cli/docker_compose_pull.yaml @@ -7,10 +7,20 @@ usage: docker compose pull [OPTIONS] [SERVICE...] pname: docker compose plink: docker_compose.yaml options: + - option: ignore-buildable + value_type: bool + default_value: "false" + description: Ignore images that can be built. + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: ignore-pull-failures value_type: bool default_value: "false" - description: Pull what it can and ignores images with pull failures + description: Pull what it can and ignores images with pull failures. deprecated: false hidden: false experimental: false @@ -20,7 +30,7 @@ options: - option: include-deps value_type: bool default_value: "false" - description: Also pull services declared as dependencies + description: Also pull services declared as dependencies. deprecated: false hidden: false experimental: false @@ -51,7 +61,7 @@ options: shorthand: q value_type: bool default_value: "false" - description: Pull without printing progress information + description: Pull without printing progress information. deprecated: false hidden: false experimental: false @@ -99,6 +109,9 @@ examples: |- ⠹ 77a0c198cde5 Waiting 9.3s ⠹ c8752d5b785c Waiting 9.3s ``` + + `docker compose pull` will try to pull image for services with a build section. If pull fails, it will let + user know this service image MUST be built. You can skip this by setting `--ignore-buildable` flag deprecated: false experimental: false experimentalcli: false diff --git a/_data/compose-cli/docker_compose_up.yaml b/_data/compose-cli/docker_compose_up.yaml index fd873ef7da..f8ab468e7b 100644 --- a/_data/compose-cli/docker_compose_up.yaml +++ b/_data/compose-cli/docker_compose_up.yaml @@ -6,6 +6,9 @@ long: |- Unless they are already running, this command also starts any linked services. The `docker compose up` command aggregates the output of each container (like `docker compose logs --follow` does). + One can optionally select a subset of services to attach to using `--attach` flag, or exclude some services using + `--no-attach` to prevent output to be flooded by some verbose services. + When the command exits, all containers are stopped. Running `docker compose up --detach` starts the containers in the background and leaves them running. @@ -104,6 +107,16 @@ options: experimentalcli: false kubernetes: false swarm: false + - option: no-attach + value_type: stringArray + default_value: '[]' + description: Don't attach to specified service. + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: no-build value_type: bool default_value: "false" diff --git a/_data/engine-cli/docker_attach.yaml b/_data/engine-cli/docker_attach.yaml index 062dfcd49c..e29783a11f 100644 --- a/_data/engine-cli/docker_attach.yaml +++ b/_data/engine-cli/docker_attach.yaml @@ -26,12 +26,12 @@ long: |- > so. It is forbidden to redirect the standard input of a `docker attach` command - while attaching to a tty-enabled container (i.e.: launched with `-t`). + while attaching to a TTY-enabled container (using the `-i` and `-t` options). - While a client is connected to container's stdio using `docker attach`, Docker - uses a ~1MB memory buffer to maximize the throughput of the application. If - this buffer is filled, the speed of the API connection will start to have an - effect on the process output writing speed. This is similar to other + While a client is connected to container's `stdio` using `docker attach`, Docker + uses a ~1MB memory buffer to maximize the throughput of the application. + Once this buffer is full, the speed of the API connection is affected, and so + this impacts the output process' writing speed. This is similar to other applications like SSH. Because of this, it is not recommended to run performance critical applications that generate a lot of output in the foreground over a slow client connection. Instead, users should use the @@ -93,45 +93,68 @@ options: examples: |- ### Attach to and detach from a running container + The following example starts an ubuntu container running `top` in detached mode, + then attaches to the container; + ```console - $ docker run -d --name topdemo ubuntu /usr/bin/top -b + $ docker run -d --name topdemo ubuntu:22.04 /usr/bin/top -b $ docker attach topdemo - top - 02:05:52 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 + top - 12:27:44 up 3 days, 21:54, 0 users, load average: 0.00, 0.00, 0.00 Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie - Cpu(s): 0.1%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st - Mem: 373572k total, 355560k used, 18012k free, 27872k buffers - Swap: 786428k total, 0k used, 786428k free, 221740k cached + %Cpu(s): 0.1 us, 0.1 sy, 0.0 ni, 99.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st + MiB Mem : 3934.3 total, 770.1 free, 674.2 used, 2490.1 buff/cache + MiB Swap: 1024.0 total, 839.3 free, 184.7 used. 2814.0 avail Mem - PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND - 1 root 20 0 17200 1116 912 R 0 0.3 0:00.03 top + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 1 root 20 0 7180 2896 2568 R 0.0 0.1 0:00.02 top + ``` - top - 02:05:55 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 - Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie - Cpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st - Mem: 373572k total, 355244k used, 18328k free, 27872k buffers - Swap: 786428k total, 0k used, 786428k free, 221776k cached + As the container was started without the `-i`, and `-t` options, signals are + forwarded to the attached process, which means that the default `CTRL-p CTRL-q` + detach key sequence produces no effect, but pressing `CTRL-c` terminates the + container: - PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND - 1 root 20 0 17208 1144 932 R 0 0.3 0:00.03 top + ```console + <...> + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 1 root 20 0 7180 2896 2568 R 0.0 0.1 0:00.02 top^P^Q + ^C + $ docker ps -a --filter name=topdemo - top - 02:05:58 up 3:06, 0 users, load average: 0.01, 0.02, 0.05 - Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie - Cpu(s): 0.2%us, 0.3%sy, 0.0%ni, 99.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st - Mem: 373572k total, 355780k used, 17792k free, 27880k buffers - Swap: 786428k total, 0k used, 786428k free, 221776k cached + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 4cf0d0ebb079 ubuntu:22.04 "/usr/bin/top -b" About a minute ago Exited (0) About a minute ago topdemo + ``` - PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND - 1 root 20 0 17208 1144 932 R 0 0.3 0:00.03 top - ^C$ + Repeating the example above, but this time with the `-i` and `-t` options set; - $ echo $? - 0 - $ docker ps -a | grep topdemo + ```console + $ docker run -dit --name topdemo2 ubuntu:22.04 /usr/bin/top -b + ``` - 7998ac8581f9 ubuntu:14.04 "/usr/bin/top -b" 38 seconds ago Exited (0) 21 seconds ago topdemo + Now, when attaching to the container, and pressing the `CTRL-p CTRL-q` ("read + escape sequence"), the Docker CLI is handling the detach sequence, and the + `attach` command is detached from the container. Checking the container's status + with `docker ps` shows that the container is still running in the background: + + ```console + $ docker attach topdemo2 + + top - 12:44:32 up 3 days, 22:11, 0 users, load average: 0.00, 0.00, 0.00 + Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie + %Cpu(s): 50.0 us, 0.0 sy, 0.0 ni, 50.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st + MiB Mem : 3934.3 total, 770.6 free, 672.4 used, 2491.4 buff/cache + MiB Swap: 1024.0 total, 839.3 free, 184.7 used. 2815.8 avail Mem + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 1 root 20 0 7180 2776 2452 R 0.0 0.1 0:00.02 topread escape sequence + + $ docker ps -a --filter name=topdemo2 + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + b1661dce0fc2 ubuntu:22.04 "/usr/bin/top -b" 2 minutes ago Up 2 minutes topdemo2 ``` ### Get the exit code of the container's command @@ -140,20 +163,19 @@ examples: |- process is returned by the `docker attach` command to its caller too: ```console - $ docker run --name test -d -it debian + $ docker run --name test -dit alpine 275c44472aebd77c926d4527885bb09f2f6db21d878c75f0a1c212c03d3bcfab $ docker attach test - root@f38c87f2a42d:/# exit 13 - - exit + /# exit 13 $ echo $? 13 - $ docker ps -a | grep test + $ docker ps -a --filter name=test - 275c44472aeb debian:7 "/bin/bash" 26 seconds ago Exited (13) 17 seconds ago test + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + a2fe3fd886db alpine "/bin/sh" About a minute ago Exited (13) 40 seconds ago test ``` deprecated: false experimental: false diff --git a/_data/engine-cli/docker_build.yaml b/_data/engine-cli/docker_build.yaml index bbdfca7014..43b6891f15 100644 --- a/_data/engine-cli/docker_build.yaml +++ b/_data/engine-cli/docker_build.yaml @@ -570,7 +570,7 @@ examples: |- expect to ignore different sets of files. - ### Tag an image (-t) + ### Tag an image (-t, --tag) ```console $ docker build -t vieux/apache:2.0 . @@ -590,7 +590,7 @@ examples: |- $ docker build -t whenry/fedora-jboss:latest -t whenry/fedora-jboss:v2.1 . ``` - ### Specify a Dockerfile (-f) + ### Specify a Dockerfile (-f, --file) ```console $ docker build -f Dockerfile.debug . @@ -637,17 +637,17 @@ examples: |- > repeatable builds on remote Docker hosts. This is also the reason why > `ADD ../file` does not work. - ### Use a custom parent cgroup (--cgroup-parent) + ### Use a custom parent cgroup (--cgroup-parent) When `docker build` is run with the `--cgroup-parent` option the containers used in the build will be run with the [corresponding `docker run` flag](../run.md#specify-custom-cgroups). - ### Set ulimits in container (--ulimit) + ### Set ulimits in container (--ulimit) Using the `--ulimit` option with `docker build` will cause each build step's - container to be started using those [`--ulimit` flag values](run.md#set-ulimits-in-container---ulimit). + container to be started using those [`--ulimit` flag values](run.md#ulimit). - ### Set build-time variables (--build-arg) + ### Set build-time variables (--build-arg) You can use `ENV` instructions in a Dockerfile to define variable values. These values persist in the built image. However, often @@ -682,16 +682,16 @@ examples: |- $ docker build --build-arg HTTP_PROXY . ``` - This is similar to how `docker run -e` works. Refer to the [`docker run` documentation](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file) + This is similar to how `docker run -e` works. Refer to the [`docker run` documentation](run.md#env) for more information. - ### Optional security options (--security-opt) + ### Optional security options (--security-opt) This flag is only supported on a daemon running on Windows, and only supports the `credentialspec` option. The `credentialspec` must be in the format `file://spec.txt` or `registry://keyname`. - ### Specify isolation technology for container (--isolation) + ### Specify isolation technology for container (--isolation) This option is useful in situations where you are running Docker containers on Windows. The `--isolation=` option sets a container's isolation @@ -707,7 +707,7 @@ examples: |- Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`. - ### Add entries to container hosts file (--add-host) + ### Add entries to container hosts file (--add-host) You can add other hosts into a container's `/etc/hosts` file by using one or more `--add-host` flags. This example adds a static address for a host named @@ -715,7 +715,7 @@ examples: |- $ docker build --add-host=docker:10.180.0.1 . - ### Specifying target build stage (--target) + ### Specifying target build stage (--target) When building a Dockerfile with multiple build stages, `--target` can be used to specify an intermediate build stage by name as a final stage for the resulting @@ -733,7 +733,14 @@ examples: |- $ docker build -t mybuildimage --target build-env . ``` - ### Custom build outputs + ### Custom build outputs (--output) + + > **Note** + > + > This feature requires the BuildKit backend. You can either + > [enable BuildKit](https://docs.docker.com/build/buildkit/#getting-started) or + > use the [buildx](https://github.com/docker/buildx) plugin which provides more + > output type options. By default, a local container image is created from the build result. The `--output` (or `-o`) flag allows you to override this behavior, and a specify a @@ -820,14 +827,14 @@ examples: |- vndr ``` + ### Specifying external cache sources (--cache-from) + > **Note** > > This feature requires the BuildKit backend. You can either > [enable BuildKit](https://docs.docker.com/build/buildkit/#getting-started) or - > use the [buildx](https://github.com/docker/buildx) plugin which provides more - > output type options. - - ### Specifying external cache sources + > use the [buildx](https://github.com/docker/buildx) plugin. The previous + > builder has limited support for reusing cache from pre-pulled images. In addition to local build cache, the builder can reuse the cache generated from previous builds with the `--cache-from` flag pointing to an image in the registry. @@ -863,14 +870,7 @@ examples: |- $ docker build --cache-from myname/myapp . ``` - > **Note** - > - > This feature requires the BuildKit backend. You can either - > [enable BuildKit](https://docs.docker.com/build/buildkit/#getting-started) or - > use the [buildx](https://github.com/docker/buildx) plugin. The previous - > builder has limited support for reusing cache from pre-pulled images. - - ### Squash an image's layers (--squash) (experimental) + ### Squash an image's layers (--squash) (experimental) #### Overview diff --git a/_data/engine-cli/docker_commit.yaml b/_data/engine-cli/docker_commit.yaml index eed4a13d28..a6e6efa2c2 100644 --- a/_data/engine-cli/docker_commit.yaml +++ b/_data/engine-cli/docker_commit.yaml @@ -66,8 +66,8 @@ examples: |- $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - c3f279d17e0a ubuntu:12.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky - 197387f1b436 ubuntu:12.04 /bin/bash 7 days ago Up 25 hours focused_hamilton + c3f279d17e0a ubuntu:22.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky + 197387f1b436 ubuntu:22.04 /bin/bash 7 days ago Up 25 hours focused_hamilton $ docker commit c3f279d17e0a svendowideit/testimage:version3 @@ -79,14 +79,14 @@ examples: |- svendowideit/testimage version3 f5283438590d 16 seconds ago 335.7 MB ``` - ### Commit a container with new configurations + ### Commit a container with new configurations (--change) ```console $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - c3f279d17e0a ubuntu:12.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky - 197387f1b436 ubuntu:12.04 /bin/bash 7 days ago Up 25 hours focused_hamilton + c3f279d17e0a ubuntu:22.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky + 197387f1b436 ubuntu:22.04 /bin/bash 7 days ago Up 25 hours focused_hamilton $ docker inspect -f "{{ .Config.Env }}" c3f279d17e0a @@ -107,8 +107,8 @@ examples: |- $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - c3f279d17e0a ubuntu:12.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky - 197387f1b436 ubuntu:12.04 /bin/bash 7 days ago Up 25 hours focused_hamilton + c3f279d17e0a ubuntu:22.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky + 197387f1b436 ubuntu:22.04 /bin/bash 7 days ago Up 25 hours focused_hamilton $ docker commit --change='CMD ["apachectl", "-DFOREGROUND"]' -c "EXPOSE 80" c3f279d17e0a svendowideit/testimage:version4 @@ -122,8 +122,8 @@ examples: |- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 89373736e2e7 testimage:version4 "apachectl -DFOREGROU" 3 seconds ago Up 2 seconds 80/tcp distracted_fermat - c3f279d17e0a ubuntu:12.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky - 197387f1b436 ubuntu:12.04 /bin/bash 7 days ago Up 25 hours focused_hamilton + c3f279d17e0a ubuntu:22.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky + 197387f1b436 ubuntu:22.04 /bin/bash 7 days ago Up 25 hours focused_hamilton ``` deprecated: false experimental: false diff --git a/_data/engine-cli/docker_config_create.yaml b/_data/engine-cli/docker_config_create.yaml index 376be84c82..e9991284f3 100644 --- a/_data/engine-cli/docker_config_create.yaml +++ b/_data/engine-cli/docker_config_create.yaml @@ -60,7 +60,7 @@ examples: |- dg426haahpi5ezmkkj5kyl3sn my_config 7 seconds ago 7 seconds ago ``` - ### Create a config with labels + ### Create a config with labels (-l, --label) ```console $ docker config create \ diff --git a/_data/engine-cli/docker_config_inspect.yaml b/_data/engine-cli/docker_config_inspect.yaml index 41b001263c..3335b0817d 100644 --- a/_data/engine-cli/docker_config_inspect.yaml +++ b/_data/engine-cli/docker_config_inspect.yaml @@ -80,7 +80,7 @@ examples: |- ] ``` - ### Formatting + ### Format the output (--format) You can use the --format option to obtain specific information about a config. The following example command outputs the creation time of the diff --git a/_data/engine-cli/docker_config_ls.yaml b/_data/engine-cli/docker_config_ls.yaml index 351c86a264..d6934213c0 100644 --- a/_data/engine-cli/docker_config_ls.yaml +++ b/_data/engine-cli/docker_config_ls.yaml @@ -53,7 +53,7 @@ examples: |- mem02h8n73mybpgqjf0kfi1n0 test_config 3 seconds ago 3 seconds ago ``` - ### Filtering + ### Filtering (-f, --filter) The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) @@ -113,7 +113,7 @@ examples: |- mem02h8n73mybpgqjf0kfi1n0 test_config About an hour ago About an hour ago ``` - ### Format the output + ### Format the output (--format) The formatting option (`--format`) pretty prints configs output using a Go template. diff --git a/_data/engine-cli/docker_container_prune.yaml b/_data/engine-cli/docker_container_prune.yaml index d45fff23f8..db52af03d1 100644 --- a/_data/engine-cli/docker_container_prune.yaml +++ b/_data/engine-cli/docker_container_prune.yaml @@ -37,7 +37,7 @@ examples: |- Total reclaimed space: 212 B ``` - ### Filtering + ### Filtering (--filter) The filtering flag (`--filter`) format is of "key=value". If there is more than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) diff --git a/_data/engine-cli/docker_context_create.yaml b/_data/engine-cli/docker_context_create.yaml index cc162463aa..562ee3c474 100644 --- a/_data/engine-cli/docker_context_create.yaml +++ b/_data/engine-cli/docker_context_create.yaml @@ -65,7 +65,7 @@ examples: |- my-context ``` - ### Create a context based on an existing context + ### Create a context based on an existing context (--from) Use the `--from=` option to create a new context from an existing context. The example below creates a new context named `my-context` diff --git a/_data/engine-cli/docker_cp.yaml b/_data/engine-cli/docker_cp.yaml index e39d37d19a..12eb2d1201 100644 --- a/_data/engine-cli/docker_cp.yaml +++ b/_data/engine-cli/docker_cp.yaml @@ -111,7 +111,7 @@ examples: |- ### Corner cases It is not possible to copy certain system files such as resources under - `/proc`, `/sys`, `/dev`, [tmpfs](run.md#mount-tmpfs---tmpfs), and mounts created by + `/proc`, `/sys`, `/dev`, [tmpfs](run.md#tmpfs), and mounts created by the user in the container. However, you can still copy such files by manually running `tar` in `docker exec`. Both of the following examples do the same thing in different ways (consider `SRC_PATH` and `DEST_PATH` are directories): diff --git a/_data/engine-cli/docker_events.yaml b/_data/engine-cli/docker_events.yaml index f5eda10eaf..45b9557f82 100644 --- a/_data/engine-cli/docker_events.yaml +++ b/_data/engine-cli/docker_events.yaml @@ -121,7 +121,7 @@ long: |- ### Limiting, filtering, and formatting the output - #### Limit events by time + #### Limit events by time (--since, --until) The `--since` and `--until` parameters can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed @@ -139,7 +139,7 @@ long: |- Only the last 1000 log events are returned. You can use filters to further limit the number of events returned. - #### Filtering + #### Filtering (--filter) The filtering flag (`-f` or `--filter`) format is of "key=value". If you would like to use multiple filters, pass multiple flags (e.g., @@ -170,7 +170,7 @@ long: |- * type (`type=`) * volume (`volume=`) - #### Format + #### Format the output (--format) If a format (`--format`) is specified, the given template will be executed instead of the default @@ -355,8 +355,8 @@ examples: |- $ docker events --filter 'container=container_1' --filter 'container=container_2' - 2014-09-03T15:49:29.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04) - 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04) + 2014-09-03T15:49:29.999999999Z07:00 container die 4386fb97867d (image=ubuntu:22.04) + 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu:22.04) 2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (imager=redis:2.8) 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8) diff --git a/_data/engine-cli/docker_exec.yaml b/_data/engine-cli/docker_exec.yaml index 9d1a7b5fb0..7e20a0cf68 100644 --- a/_data/engine-cli/docker_exec.yaml +++ b/_data/engine-cli/docker_exec.yaml @@ -7,13 +7,13 @@ long: |- process (`PID 1`) is running, and it is not restarted if the container is restarted. - COMMAND will run in the default directory of the container. If the - underlying image has a custom directory specified with the WORKDIR directive - in its Dockerfile, this will be used instead. + COMMAND runs in the default directory of the container. If the underlying image + has a custom directory specified with the WORKDIR directive in its Dockerfile, + this directory is used instead. - COMMAND should be an executable, a chained or a quoted command - will not work. Example: `docker exec -ti my_container "echo a && echo b"` will - not work, but `docker exec -ti my_container sh -c "echo a && echo b"` will. + COMMAND must be an executable. A chained or a quoted command does not work. + For example, `docker exec -it my_container sh -c "echo a && echo b"` works, + work, but `docker exec -it my_container "echo a && echo b"` does not. usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...] pname: docker plink: docker.yaml @@ -103,80 +103,40 @@ options: experimentalcli: false kubernetes: false swarm: false -examples: |- - ### Run `docker exec` on a running container - - First, start a container. - - ```console - $ docker run --name ubuntu_bash --rm -i -t ubuntu bash - ``` - - This will create a container named `ubuntu_bash` and start a Bash session. - - Next, execute a command on the container. - - ```console - $ docker exec -d ubuntu_bash touch /tmp/execWorks - ``` - - This will create a new file `/tmp/execWorks` inside the running container - `ubuntu_bash`, in the background. - - Next, execute an interactive `bash` shell on the container. - - ```console - $ docker exec -it ubuntu_bash bash - ``` - - This will create a new Bash session in the container `ubuntu_bash`. - - Next, set an environment variable in the current bash session. - - ```console - $ docker exec -it -e VAR=1 ubuntu_bash bash - ``` - - This will create a new Bash session in the container `ubuntu_bash` with environment - variable `$VAR` set to "1". Note that this environment variable will only be valid - on the current Bash session. - - By default `docker exec` command runs in the same working directory set when container was created. - - ```console - $ docker exec -it ubuntu_bash pwd - / - ``` - - You can select working directory for the command to execute into - - ```console - $ docker exec -it -w /root ubuntu_bash pwd - /root - ``` - - - ### Try to run `docker exec` on a paused container - - If the container is paused, then the `docker exec` command will fail with an error: - - ```console - $ docker pause test - - test - - $ docker ps - - CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - 1ae3b36715d2 ubuntu:latest "bash" 17 seconds ago Up 16 seconds (Paused) test - - $ docker exec test ls - - FATA[0000] Error response from daemon: Container test is paused, unpause the container before exec - - $ echo $? - 1 - ``` +examples: "### Run `docker exec` on a running container\n\nFirst, start a container.\n\n```console\n$ + docker run --name mycontainer -d -i -t alpine /bin/sh\n```\n\nThis creates and starts + a container named `mycontainer` from an `alpine` image\nwith an `sh` shell as its + main process. The `-d` option (shorthand for `--detach`)\nsets the container to + run in the background, in detached mode, with a pseudo-TTY\nattached (`-t`). The + `-i` option is set to keep `STDIN` attached (`-i`), which\nprevents the `sh` process + from exiting immediately.\n\nNext, execute a command on the container.\n\n```console\n$ + docker exec -d mycontainer touch /tmp/execWorks\n```\n\nThis creates a new file + `/tmp/execWorks` inside the running container\n`mycontainer`, in the background.\n\nNext, + execute an interactive `sh` shell on the container.\n\n```console\n$ docker exec + -it mycontainer sh\n```\n\nThis starts a new shell session in the container `mycontainer`.\n\n### + Set environment variables for the exec process (--env, -e)\n\nNext, + set environment variables in the current bash session.\n\nBy default, the `docker + exec` command, inherits the environment variables that\nare set at the time the + container is created. Use the `--env` (or the `-e` shorthand)\nto override global + environment variables, or to set additional environment variables\nfor the process + started by `docker exec`.\n\nThe example below creates a new shell session in the + container `mycontainer` with\nenvironment variables `$VAR_A` and `$VAR_B` set to + \"1\" and \"2\" respectively.\nThese environment variables are only valid for the + `sh` process started by that\n`docker exec` command, and are not available to other + processes running inside\nthe container.\n\n```console\n$ docker exec -e VAR_A=1 + -e VAR_B=2 mycontainer env\nPATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\nHOSTNAME=f64a4851eb71\nVAR_A=1\nVAR_B=2\nHOME=/root\n```\n\n### + Set the working directory for the exec process (--workdir, + -w)\n\nBy default `docker exec` command runs in the same working directory set when + \nthe container was created.\n\n```console\n$ docker exec -it mycontainer pwd\n/\n```\n\nYou + can specify an alternative working directory for the command to execute \nusing + the `--workdir` option (or the `-w` shorthand):\n\n```console\n$ docker exec -it + -w /root mycontainer pwd\n/root\n```\n\n\n### Try to run `docker exec` on a paused + container\n\nIf the container is paused, then the `docker exec` command fails with + an error:\n\n```console\n$ docker pause mycontainer\nmycontainer\n\n$ docker ps\n\nCONTAINER + ID IMAGE COMMAND CREATED STATUS PORTS NAMES\n482efdf39fac + \ alpine \"/bin/sh\" 17 seconds ago Up 16 seconds (Paused) mycontainer\n\n$ + docker exec mycontainer sh\n\nError response from daemon: Container mycontainer + is paused, unpause the container before exec\n\n$ echo $?\n1\n```" deprecated: false experimental: false experimentalcli: false diff --git a/_data/engine-cli/docker_export.yaml b/_data/engine-cli/docker_export.yaml index f2cd6d68e5..a5fd064131 100644 --- a/_data/engine-cli/docker_export.yaml +++ b/_data/engine-cli/docker_export.yaml @@ -6,7 +6,7 @@ long: |- the container, `docker export` will export the contents of the *underlying* directory, not the contents of the volume. - Refer to [Back up, restore, or migrate data volumes](https://docs.docker.com/storage/volumes/#back-up-restore-or-migrate-data-volumes) + Refer to [Backup, restore, or migrate data volumes](https://docs.docker.com/storage/volumes/#back-up-restore-or-migrate-data-volumes) in the user guide for examples on exporting data in a volume. usage: docker export [OPTIONS] CONTAINER pname: docker diff --git a/_data/engine-cli/docker_history.yaml b/_data/engine-cli/docker_history.yaml index 64db5a5894..9fa0f65fe1 100644 --- a/_data/engine-cli/docker_history.yaml +++ b/_data/engine-cli/docker_history.yaml @@ -68,7 +68,7 @@ examples: |- 511136ea3c5a 19 months ago 0 B Imported from - ``` - ### Format the output + ### Format the output (--format) The formatting option (`--format`) will pretty-prints history output using a Go template. diff --git a/_data/engine-cli/docker_image_prune.yaml b/_data/engine-cli/docker_image_prune.yaml index 7ffbdf3a09..cea6ab0a76 100644 --- a/_data/engine-cli/docker_image_prune.yaml +++ b/_data/engine-cli/docker_image_prune.yaml @@ -70,7 +70,7 @@ examples: |- Total reclaimed space: 16.43 MB ``` - ### Filtering + ### Filtering (--filter) The filtering flag (`--filter`) format is of "key=value". If there is more than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) diff --git a/_data/engine-cli/docker_images.yaml b/_data/engine-cli/docker_images.yaml index 2532e2fcce..4f1795e259 100644 --- a/_data/engine-cli/docker_images.yaml +++ b/_data/engine-cli/docker_images.yaml @@ -133,7 +133,7 @@ examples: |- REPOSITORY TAG IMAGE ID CREATED SIZE ``` - ### List the full length image IDs + ### List the full length image IDs (--no-trunc) ```console $ docker images --no-trunc @@ -150,7 +150,7 @@ examples: |- sha256:5ed6274db6ceb2397844896966ea239290555e74ef307030ebb01ff91b1914df 24 hours ago 1.089 GB ``` - ### List image digests + ### List image digests (--digests) Images that use the v2 or later format have a content-addressable identifier called a `digest`. As long as the input used to generate the image is @@ -168,7 +168,7 @@ examples: |- also reference by digest in `create`, `run`, and `rmi` commands, as well as the `FROM` image reference in a Dockerfile. - ### Filtering + ### Filtering (--filter) The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) @@ -316,7 +316,7 @@ examples: |- busybox glibc 21c16b6787c6 5 weeks ago 4.19 MB ``` - ### Format the output + ### Format the output (--format) The formatting option (`--format`) will pretty print container output using a Go template. diff --git a/_data/engine-cli/docker_info.yaml b/_data/engine-cli/docker_info.yaml index 88643e3286..7ba2f05360 100644 --- a/_data/engine-cli/docker_info.yaml +++ b/_data/engine-cli/docker_info.yaml @@ -34,9 +34,9 @@ options: examples: |- ### Show output - The example below shows the output for a daemon running on Red Hat Enterprise Linux, - using the `devicemapper` storage driver. As can be seen in the output, additional - information about the `devicemapper` storage driver is shown: + The example below shows the output for a daemon running on Ubuntu Linux, + using the `overlay2` storage driver. As can be seen in the output, additional + information about the `overlay2` storage driver is shown: ```console $ docker info @@ -44,6 +44,16 @@ examples: |- Client: Context: default Debug Mode: false + Plugins: + buildx: Docker Buildx (Docker Inc.) + Version: v0.8.2 + Path: /usr/libexec/docker/cli-plugins/docker-buildx + compose: Docker Compose (Docker Inc.) + Version: v2.6.0 + Path: /usr/libexec/docker/cli-plugins/docker-compose + scan: Docker Scan (Docker Inc.) + Version: v0.17.0 + Path: /usr/libexec/docker/cli-plugins/docker-scan Server: Containers: 14 @@ -51,142 +61,52 @@ examples: |- Paused: 1 Stopped: 10 Images: 52 - Server Version: 1.10.3 - Storage Driver: devicemapper - Pool Name: docker-202:2-25583803-pool - Pool Blocksize: 65.54 kB - Base Device Size: 10.74 GB - Backing Filesystem: xfs - Data file: /dev/loop0 - Metadata file: /dev/loop1 - Data Space Used: 1.68 GB - Data Space Total: 107.4 GB - Data Space Available: 7.548 GB - Metadata Space Used: 2.322 MB - Metadata Space Total: 2.147 GB - Metadata Space Available: 2.145 GB - Udev Sync Supported: true - Deferred Removal Enabled: false - Deferred Deletion Enabled: false - Deferred Deleted Device Count: 0 - Data loop file: /var/lib/docker/devicemapper/devicemapper/data - Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata - Library Version: 1.02.107-RHEL7 (2015-12-01) - Execution Driver: native-0.2 + Server Version: 22.06.0 + Storage Driver: overlay2 + Backing Filesystem: extfs + Supports d_type: true + Using metacopy: false + Native Overlay Diff: true + userxattr: false Logging Driver: json-file + Cgroup Driver: systemd + Cgroup Version: 2 Plugins: Volume: local - Network: null host bridge - Kernel Version: 3.10.0-327.el7.x86_64 - Operating System: Red Hat Enterprise Linux Server 7.2 (Maipo) + Network: bridge host ipvlan macvlan null overlay + Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog + Swarm: inactive + Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc + Default Runtime: runc + Init Binary: docker-init + containerd version: 212e8b6fa2f44b9c21b2798135fc6fb7c53efc16 + runc version: v1.1.1-0-g52de29d + init version: de40ad0 + Security Options: + apparmor + seccomp + Profile: builtin + cgroupns + Kernel Version: 5.15.0-25-generic + Operating System: Ubuntu 22.04 LTS OSType: linux Architecture: x86_64 CPUs: 1 Total Memory: 991.7 MiB Name: ip-172-30-0-91.ec2.internal - ID: I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S + ID: 4cee4408-10d2-4e17-891c-a41736ac4536 Docker Root Dir: /var/lib/docker Debug Mode: false Username: gordontheturtle Registry: https://index.docker.io/v1/ + Experimental: false Insecure registries: myinsecurehost:5000 127.0.0.0/8 - ``` - - ### Show debugging output - - Here is a sample output for a daemon running on Ubuntu, using the overlay2 - storage driver and a node that is part of a 2-node swarm: - - ```console - $ docker --debug info - - Client: - Context: default - Debug Mode: true - - Server: - Containers: 14 - Running: 3 - Paused: 1 - Stopped: 10 - Images: 52 - Server Version: 1.13.0 - Storage Driver: overlay2 - Backing Filesystem: extfs - Supports d_type: true - Native Overlay Diff: false - Logging Driver: json-file - Cgroup Driver: cgroupfs - Plugins: - Volume: local - Network: bridge host macvlan null overlay - Swarm: active - NodeID: rdjq45w1op418waxlairloqbm - Is Manager: true - ClusterID: te8kdyw33n36fqiz74bfjeixd - Managers: 1 - Nodes: 2 - Orchestration: - Task History Retention Limit: 5 - Raft: - Snapshot Interval: 10000 - Number of Old Snapshots to Retain: 0 - Heartbeat Tick: 1 - Election Tick: 3 - Dispatcher: - Heartbeat Period: 5 seconds - CA Configuration: - Expiry Duration: 3 months - Root Rotation In Progress: false - Node Address: 172.16.66.128 172.16.66.129 - Manager Addresses: - 172.16.66.128:2477 - Runtimes: runc - Default Runtime: runc - Init Binary: docker-init - containerd version: 8517738ba4b82aff5662c97ca4627e7e4d03b531 - runc version: ac031b5bf1cc92239461125f4c1ffb760522bbf2 - init version: N/A (expected: v0.13.0) - Security Options: - apparmor - seccomp - Profile: default - Kernel Version: 4.4.0-31-generic - Operating System: Ubuntu 16.04.1 LTS - OSType: linux - Architecture: x86_64 - CPUs: 2 - Total Memory: 1.937 GiB - Name: ubuntu - ID: H52R:7ZR6:EIIA:76JG:ORIY:BVKF:GSFU:HNPG:B5MK:APSC:SZ3Q:N326 - Docker Root Dir: /var/lib/docker - Debug Mode: true - File Descriptors: 30 - Goroutines: 123 - System Time: 2016-11-12T17:24:37.955404361-08:00 - EventsListeners: 0 - Http Proxy: http://test:test@proxy.example.com:8080 - Https Proxy: https://test:test@proxy.example.com:8080 - No Proxy: localhost,127.0.0.1,docker-registry.somecorporation.com - Registry: https://index.docker.io/v1/ - WARNING: No swap limit support - Labels: - storage=ssd - staging=true - Experimental: false - Insecure Registries: - 127.0.0.0/8 - Registry Mirrors: - http://192.168.1.2/ - http://registry-mirror.example.com:5000/ Live Restore Enabled: false ``` - The global `-D` option causes all `docker` commands to output debug information. - - ### Format the output + ### Format the output (--format) You can also specify the output format: @@ -198,13 +118,18 @@ examples: |- ### Run `docker info` on Windows - Here is a sample output for a daemon running on Windows Server 2016: + Here is a sample output for a daemon running on Windows Server: ```console - E:\docker>docker info + C:\> docker info + Client: Context: default Debug Mode: false + Plugins: + buildx: Docker Buildx (Docker Inc., v0.8.2-docker) + compose: Docker Compose (Docker Inc., v2.6.0) + scan: Docker Scan (Docker Inc., v0.17.0) Server: Containers: 1 @@ -212,27 +137,29 @@ examples: |- Paused: 0 Stopped: 1 Images: 17 - Server Version: 1.13.0 + Server Version: 20.10.16 Storage Driver: windowsfilter - Windows: Logging Driver: json-file Plugins: Volume: local - Network: nat null overlay + Network: ics internal l2bridge l2tunnel nat null overlay private transparent + Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog Swarm: inactive Default Isolation: process - Kernel Version: 10.0 14393 (14393.206.amd64fre.rs1_release.160912-1937) - Operating System: Windows Server 2016 Datacenter + Kernel Version: 10.0 20348 (20348.1.amd64fre.fe_release.210507-1500) + Operating System: Microsoft Windows Server Version 21H2 (OS Build 20348.707) OSType: windows Architecture: x86_64 CPUs: 8 Total Memory: 3.999 GiB Name: WIN-V0V70C0LU5P - ID: NYMS:B5VK:UMSL:FVDZ:EWB5:FKVK:LPFL:FJMQ:H6FT:BZJ6:L2TD:XH62 - Docker Root Dir: C:\control + ID: 2880d38d-464e-4d01-91bd-c76f33ba3981 + Docker Root Dir: C:\ProgramData\docker Debug Mode: false Registry: https://index.docker.io/v1/ + Experimental: true Insecure Registries: + myregistry:5000 127.0.0.0/8 Registry Mirrors: http://192.168.1.2/ diff --git a/_data/engine-cli/docker_inspect.yaml b/_data/engine-cli/docker_inspect.yaml index bd610aa1f1..1415805542 100644 --- a/_data/engine-cli/docker_inspect.yaml +++ b/_data/engine-cli/docker_inspect.yaml @@ -4,6 +4,59 @@ long: |- Docker inspect provides detailed information on constructs controlled by Docker. By default, `docker inspect` will render results in a JSON array. + + ### Format the output (--format) + + If a format is specified, the given template will be executed for each result. + + Go's [text/template](https://golang.org/pkg/text/template/) package describes + all the details of the format. + + ### Specify target type (--type) + + `--type container|image|node|network|secret|service|volume|task|plugin` + + The `docker inspect` command matches any type of object by either ID or name. In + some cases multiple type of objects (for example, a container and a volume) + exist with the same name, making the result ambiguous. + + To restrict `docker inspect` to a specific type of object, use the `--type` + option. + + The following example inspects a _volume_ named "myvolume" + + ```console + $ docker inspect --type=volume myvolume + ``` + + ### Inspect the size of a container (-s, --size) + + The `--size`, or short-form `-s`, option adds two additional fields to the + `docker inspect` output. This option only works for containers. The container + doesn't have to be running, it also works for stopped containers. + + ```console + $ docker inspect --size mycontainer + ``` + + The output includes the full output of a regular `docker inspect` command, with + the following additional fields: + + - `SizeRootFs`: the total size of all the files in the container, in bytes. + - `SizeRw`: the size of the files that have been created or changed in the + container, compared to it's image, in bytes. + + ```console + $ docker run --name database -d redis + 3b2cbf074c99db4a0cad35966a9e24d7bc277f5565c17233386589029b7db273 + $ docker inspect --size database -f '{{ .SizeRootFs }}' + 123125760 + $ docker inspect --size database -f '{{ .SizeRw }}' + 8192 + $ docker exec database fallocate -l 1000 /newfile + $ docker inspect --size database -f '{{ .SizeRw }}' + 12288 + ``` usage: docker inspect [OPTIONS] NAME|ID [NAME|ID...] pname: docker plink: docker.yaml @@ -65,8 +118,7 @@ examples: |- ### List all port bindings - You can loop over arrays and maps in the results to produce simple text - output: + You can loop over arrays and maps in the results to produce simple text output: ```console $ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' $INSTANCE_ID @@ -74,13 +126,12 @@ examples: |- ### Find a specific port mapping - The `.Field` syntax doesn't work when the field name begins with a - number, but the template language's `index` function does. The - `.NetworkSettings.Ports` section contains a map of the internal port - mappings to a list of external address/port objects. To grab just the - numeric public port, you use `index` to find the specific port map, and - then `index` 0 contains the first object inside of that. Then we ask for - the `HostPort` field to get the public address. + The `.Field` syntax doesn't work when the field name begins with a number, but + the template language's `index` function does. The `.NetworkSettings.Ports` + section contains a map of the internal port mappings to a list of external + address/port objects. To grab just the numeric public port, you use `index` to + find the specific port map, and then `index` 0 contains the first object inside + of that. Then we ask for the `HostPort` field to get the public address. ```console $ docker inspect --format='{{(index (index .NetworkSettings.Ports "8787/tcp") 0).HostPort}}' $INSTANCE_ID @@ -88,10 +139,9 @@ examples: |- ### Get a subsection in JSON format - If you request a field which is itself a structure containing other - fields, by default you get a Go-style dump of the inner values. - Docker adds a template function, `json`, which can be applied to get - results in JSON format. + If you request a field which is itself a structure containing other fields, by + default you get a Go-style dump of the inner values. Docker adds a template + function, `json`, which can be applied to get results in JSON format. ```console $ docker inspect --format='{{json .Config}}' $INSTANCE_ID diff --git a/_data/engine-cli/docker_kill.yaml b/_data/engine-cli/docker_kill.yaml index d13cb948c4..6cda0bd0b3 100644 --- a/_data/engine-cli/docker_kill.yaml +++ b/_data/engine-cli/docker_kill.yaml @@ -45,7 +45,7 @@ examples: |- $ docker kill my_container ``` - ### Send a custom signal to a container + ### Send a custom signal to a container (--signal) The following example sends a `SIGHUP` signal to the container named `my_container`: diff --git a/_data/engine-cli/docker_load.yaml b/_data/engine-cli/docker_load.yaml index 40032d7cc4..e29ed84a0b 100644 --- a/_data/engine-cli/docker_load.yaml +++ b/_data/engine-cli/docker_load.yaml @@ -31,18 +31,25 @@ examples: |- $ docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE + ``` + ### Load images from STDIN + + ```console $ docker load < busybox.tar.gz Loaded image: busybox:latest $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE busybox latest 769b9341d937 7 weeks ago 2.489 MB + ``` + ### Load images from a file (--input) + + ```console $ docker load --input fedora.tar Loaded image: fedora:rawhide - Loaded image: fedora:20 $ docker images diff --git a/_data/engine-cli/docker_login.yaml b/_data/engine-cli/docker_login.yaml index c8173e2675..ac6593d520 100644 --- a/_data/engine-cli/docker_login.yaml +++ b/_data/engine-cli/docker_login.yaml @@ -42,7 +42,7 @@ examples: |- $ docker login localhost:8080 ``` - ### Provide a password using STDIN + ### Provide a password using STDIN (--password-stdin) To run the `docker login` command non-interactively, you can set the `--password-stdin` flag to provide a password through `STDIN`. Using diff --git a/_data/engine-cli/docker_logs.yaml b/_data/engine-cli/docker_logs.yaml index c833a2192b..64158a28f7 100644 --- a/_data/engine-cli/docker_logs.yaml +++ b/_data/engine-cli/docker_logs.yaml @@ -3,11 +3,6 @@ short: Fetch the logs of a container long: |- The `docker logs` command batch-retrieves logs present at the time of execution. - > **Note** - > - > This command is only functional for containers that are started with the - > `json-file` or `journald` logging driver. - For more information about selecting and configuring logging drivers, refer to [Configure logging drivers](https://docs.docker.com/config/containers/logging/configure/). @@ -101,7 +96,7 @@ options: kubernetes: false swarm: false examples: |- - ### Retrieve logs until a specific point in time + ### Retrieve logs until a specific point in time (--until) In order to retrieve logs before a specific point in time, run: diff --git a/_data/engine-cli/docker_network_connect.yaml b/_data/engine-cli/docker_network_connect.yaml index c8700505dd..9224936676 100644 --- a/_data/engine-cli/docker_network_connect.yaml +++ b/_data/engine-cli/docker_network_connect.yaml @@ -75,7 +75,7 @@ examples: |- $ docker run -itd --network=multi-host-network busybox ``` - ### Specify the IP address a container will use on a given network + ### Specify the IP address a container will use on a given network (--ip) You can specify the IP address you want to be assigned to the container's interface. @@ -83,7 +83,7 @@ examples: |- $ docker network connect --ip 10.10.36.122 multi-host-network container2 ``` - ### Use the legacy `--link` option + ### Use the legacy `--link` option (--link) You can use `--link` option to link another container with a preferred alias @@ -91,7 +91,7 @@ examples: |- $ docker network connect --link container1:c1 multi-host-network container2 ``` - ### Create a network alias for a container + ### Create a network alias for a container (--alias) `--alias` option can be used to resolve the container by another name in the network being connected to. diff --git a/_data/engine-cli/docker_network_create.yaml b/_data/engine-cli/docker_network_create.yaml index f4e920eb98..3795d69a1a 100644 --- a/_data/engine-cli/docker_network_create.yaml +++ b/_data/engine-cli/docker_network_create.yaml @@ -313,14 +313,14 @@ examples: |- simple-network ``` - ### Network internal mode + ### Network internal mode (--internal) By default, when you connect a container to an `overlay` network, Docker also connects a bridge network to it to provide external connectivity. If you want to create an externally isolated `overlay` network, you can specify the `--internal` option. - ### Network ingress mode + ### Network ingress mode (--ingress) You can create the network which will be used to provide the routing-mesh in the swarm cluster. You do so by specifying `--ingress` when creating the network. Only diff --git a/_data/engine-cli/docker_network_ls.yaml b/_data/engine-cli/docker_network_ls.yaml index dcc05a3bfa..0f234253b7 100644 --- a/_data/engine-cli/docker_network_ls.yaml +++ b/_data/engine-cli/docker_network_ls.yaml @@ -68,7 +68,7 @@ examples: |- 63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 dev bridge local ``` - ### Filtering + ### Filtering (--filter) The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`). @@ -213,7 +213,7 @@ examples: |- A warning will be issued when trying to remove a network that has containers attached. - ### Formatting + ### Format the output (--format) The formatting options (`--format`) pretty-prints networks output using a Go template. diff --git a/_data/engine-cli/docker_network_prune.yaml b/_data/engine-cli/docker_network_prune.yaml index 1b23b8c5ca..7434b05464 100644 --- a/_data/engine-cli/docker_network_prune.yaml +++ b/_data/engine-cli/docker_network_prune.yaml @@ -36,7 +36,7 @@ examples: |- n2 ``` - ### Filtering + ### Filtering (--filter) The filtering flag (`--filter`) format is of "key=value". If there is more than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) diff --git a/_data/engine-cli/docker_node_inspect.yaml b/_data/engine-cli/docker_node_inspect.yaml index 29ad73d0f5..bcf540e9e3 100644 --- a/_data/engine-cli/docker_node_inspect.yaml +++ b/_data/engine-cli/docker_node_inspect.yaml @@ -113,7 +113,7 @@ examples: |- ] ``` - ### Specify an output format + ### Format the output (--format) ```console $ docker node inspect --format '{{ .ManagerStatus.Leader }}' self diff --git a/_data/engine-cli/docker_node_ls.yaml b/_data/engine-cli/docker_node_ls.yaml index a6041eac64..a321eaae62 100644 --- a/_data/engine-cli/docker_node_ls.yaml +++ b/_data/engine-cli/docker_node_ls.yaml @@ -3,7 +3,7 @@ aliases: list short: List nodes in the swarm long: |- Lists all the nodes that the Docker Swarm manager knows about. You can filter - using the `-f` or `--filter` flag. Refer to the [filtering](#filtering) section + using the `-f` or `--filter` flag. Refer to the [filtering](#filter) section for more information about available filter options. > **Note** @@ -60,7 +60,7 @@ examples: |- > `e216jshn25ckzbvmwlnh5jr3g *`) means this node is the current docker daemon. - ### Filtering + ### Filtering (--filter) The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) @@ -178,7 +178,7 @@ examples: |- e216jshn25ckzbvmwlnh5jr3g * swarm-manager1 Ready Active Leader ``` - ### Formatting + ### Format the output (--format) The formatting options (`--format`) pretty-prints nodes output using a Go template. diff --git a/_data/engine-cli/docker_node_ps.yaml b/_data/engine-cli/docker_node_ps.yaml index 3f3079bb88..b3dff83a7d 100644 --- a/_data/engine-cli/docker_node_ps.yaml +++ b/_data/engine-cli/docker_node_ps.yaml @@ -2,7 +2,7 @@ command: docker node ps short: List tasks running on one or more nodes, defaults to current node long: |- Lists all the tasks on a Node that Docker knows about. You can filter using the - `-f` or `--filter` flag. Refer to the [filtering](#filtering) section for more + `-f` or `--filter` flag. Refer to the [filtering](#filter) section for more information about available filter options. > **Note** @@ -72,7 +72,7 @@ examples: |- redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds ``` - ### Filtering + ### Filtering (--filter) The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) @@ -133,7 +133,7 @@ examples: |- The `desired-state` filter can take the values `running`, `shutdown`, or `accepted`. - ### Formatting + ### Format the output (--format) The formatting options (`--format`) pretty-prints tasks output using a Go template. diff --git a/_data/engine-cli/docker_node_rm.yaml b/_data/engine-cli/docker_node_rm.yaml index 2cdab5778d..99c1c8f075 100644 --- a/_data/engine-cli/docker_node_rm.yaml +++ b/_data/engine-cli/docker_node_rm.yaml @@ -45,7 +45,7 @@ examples: |- down and can't be removed ``` - ### Forcibly remove an inaccessible node from a swarm + ### Forcibly remove an inaccessible node from a swarm (--force) If you lose access to a worker node or need to shut it down because it has been compromised or is not behaving as expected, you can use the `--force` option. diff --git a/_data/engine-cli/docker_node_update.yaml b/_data/engine-cli/docker_node_update.yaml index 3e1cb42ec9..c2a18feef0 100644 --- a/_data/engine-cli/docker_node_update.yaml +++ b/_data/engine-cli/docker_node_update.yaml @@ -46,7 +46,7 @@ options: kubernetes: false swarm: false examples: |- - ### Add label metadata to a node + ### Add label metadata to a node (--label-add) Add metadata to a swarm node using node labels. You can specify a node label as a key with an empty value: diff --git a/_data/engine-cli/docker_plugin_inspect.yaml b/_data/engine-cli/docker_plugin_inspect.yaml index 0f67e4d4ec..12e272a7ad 100644 --- a/_data/engine-cli/docker_plugin_inspect.yaml +++ b/_data/engine-cli/docker_plugin_inspect.yaml @@ -136,7 +136,7 @@ examples: |- ``` - ### Formatting the output + ### Format the output (--format) ```console $ docker plugin inspect -f '{{.Id}}' tiborvass/sample-volume-plugin:latest diff --git a/_data/engine-cli/docker_plugin_ls.yaml b/_data/engine-cli/docker_plugin_ls.yaml index c2659bfdcd..8c8fba3850 100644 --- a/_data/engine-cli/docker_plugin_ls.yaml +++ b/_data/engine-cli/docker_plugin_ls.yaml @@ -5,7 +5,7 @@ long: |- Lists all the plugins that are currently installed. You can install plugins using the [`docker plugin install`](plugin_install.md) command. You can also filter using the `-f` or `--filter` flag. - Refer to the [filtering](#filtering) section for more information about available filter options. + Refer to the [filtering](#filter) section for more information about available filter options. usage: docker plugin ls [OPTIONS] pname: docker plugin plink: docker_plugin.yaml @@ -54,7 +54,7 @@ examples: |- 69553ca1d123 tiborvass/sample-volume-plugin:latest A test plugin for Docker true ``` - ### Filtering + ### Filtering (--filter) The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) @@ -84,7 +84,7 @@ examples: |- ID NAME DESCRIPTION ENABLED ``` - ### Formatting + ### Format the output (--format) The formatting options (`--format`) pretty-prints plugins output using a Go template. diff --git a/_data/engine-cli/docker_ps.yaml b/_data/engine-cli/docker_ps.yaml index 15b1facd5c..f93a48f062 100644 --- a/_data/engine-cli/docker_ps.yaml +++ b/_data/engine-cli/docker_ps.yaml @@ -82,7 +82,7 @@ options: kubernetes: false swarm: false examples: |- - ### Prevent truncating output + ### Do not truncate output (--no-trunc) Running `docker ps --no-trunc` showing 2 linked containers. @@ -90,14 +90,14 @@ examples: |- $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - 4c01db0b339c ubuntu:12.04 bash 17 seconds ago Up 16 seconds 3300-3310/tcp webapp + 4c01db0b339c ubuntu:22.04 bash 17 seconds ago Up 16 seconds 3300-3310/tcp webapp d7886598dbe2 crosbymichael/redis:latest /redis-server --dir 33 minutes ago Up 33 minutes 6379/tcp redis,webapp/db ``` - ### Show both running and stopped containers + ### Show both running and stopped containers (-a, --all) The `docker ps` command only shows running containers by default. To see all - containers, use the `-a` (or `--all`) flag: + containers, use the `--all` (or `-a`) flag: ```console $ docker ps -a @@ -107,12 +107,12 @@ examples: |- container that exposes TCP ports `100, 101, 102` displays `100-102/tcp` in the `PORTS` column. - ### Show disk usage by container + ### Show disk usage by container (--size) - The `docker ps -s` command displays two different on-disk-sizes for each container: + The `docker ps --size` (or `-s`) command displays two different on-disk-sizes for each container: ```console - $ docker ps -s + $ docker ps --size CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES SIZE SIZE e90b8831a4b8 nginx "/bin/bash -c 'mkdir " 11 weeks ago Up 4 hours my_nginx 35.58 kB (virtual 109.2 MB) @@ -124,9 +124,9 @@ examples: |- For more information, refer to the [container size on disk](https://docs.docker.com/storage/storagedriver/#container-size-on-disk) section. - ### Filtering + ### Filtering (--filter) - The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more + The `--filter` (or `-f`) flag format is a `key=value` pair. If there is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`) The currently supported filters are: @@ -287,13 +287,13 @@ examples: |- 919e1179bdb8 ubuntu-c1 "top" About a minute ago Up About a minute admiring_lovelace ``` - Match containers based on the `ubuntu` version `12.04.5` image: + Match containers based on the `ubuntu` version `22.04` image: ```console - $ docker ps --filter ancestor=ubuntu:12.04.5 + $ docker ps --filter ancestor=ubuntu:22.04 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - 82a598284012 ubuntu:12.04.5 "top" 3 minutes ago Up 3 minutes sleepy_bose + 82a598284012 ubuntu:22.04 "top" 3 minutes ago Up 3 minutes sleepy_bose ``` The following matches containers based on the layer `d0e008c6cf02` or an image @@ -303,7 +303,7 @@ examples: |- $ docker ps --filter ancestor=d0e008c6cf02 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - 82a598284012 ubuntu:12.04.5 "top" 3 minutes ago Up 3 minutes sleepy_bose + 82a598284012 ubuntu:22.04 "top" 3 minutes ago Up 3 minutes sleepy_bose ``` #### Create time @@ -435,7 +435,7 @@ examples: |- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ``` - ### Formatting + ### Format the output (--format) The formatting option (`--format`) pretty-prints container output using a Go template. diff --git a/_data/engine-cli/docker_pull.yaml b/_data/engine-cli/docker_pull.yaml index b33ba647c8..4ff66d2707 100644 --- a/_data/engine-cli/docker_pull.yaml +++ b/_data/engine-cli/docker_pull.yaml @@ -71,36 +71,36 @@ examples: |- ### Pull an image from Docker Hub To download a particular image, or set of images (i.e., a repository), use - `docker pull`. If no tag is provided, Docker Engine uses the `:latest` tag as a - default. This command pulls the `debian:latest` image: + `docker image pull` (or the `docker pull` shorthand). If no tag is provided, + Docker Engine uses the `:latest` tag as a default. This example pulls the + `debian:latest` image: ```console - $ docker pull debian + $ docker image pull debian Using default tag: latest latest: Pulling from library/debian - fdd5d7827f33: Pull complete - a3ed95caeb02: Pull complete - Digest: sha256:e7d38b3517548a1c71e41bffe9c8ae6d6d29546ce46bf62159837aad072c90aa + e756f3fdd6a3: Pull complete + Digest: sha256:3f1d6c17773a45c97bd8f158d665c9709d7b29ed7917ac934086ad96f92e4510 Status: Downloaded newer image for debian:latest + docker.io/library/debian:latest ``` Docker images can consist of multiple layers. In the example above, the image - consists of two layers; `fdd5d7827f33` and `a3ed95caeb02`. + consists of a single layer; `e756f3fdd6a3`. - Layers can be reused by images. For example, the `debian:jessie` image shares - both layers with `debian:latest`. Pulling the `debian:jessie` image therefore - only pulls its metadata, but not its layers, because all layers are already - present locally: + Layers can be reused by images. For example, the `debian:bullseye` image shares + its layer with the `debian:latest`. Pulling the `debian:bullseye` image therefore + only pulls its metadata, but not its layers, because the layer is already present + locally: ```console - $ docker pull debian:jessie + $ docker image pull debian:bullseye - jessie: Pulling from library/debian - fdd5d7827f33: Already exists - a3ed95caeb02: Already exists - Digest: sha256:a9c958be96d7d40df920e7041608f2f017af81800ca5ad23e327bc402626b58e - Status: Downloaded newer image for debian:jessie + bullseye: Pulling from library/debian + Digest: sha256:3f1d6c17773a45c97bd8f158d665c9709d7b29ed7917ac934086ad96f92e4510 + Status: Downloaded newer image for debian:bullseye + docker.io/library/debian:bullseye ``` To see which images are present locally, use the [`docker images`](images.md) @@ -109,17 +109,16 @@ examples: |- ```console $ docker images - REPOSITORY TAG IMAGE ID CREATED SIZE - debian jessie f50f9524513f 5 days ago 125.1 MB - debian latest f50f9524513f 5 days ago 125.1 MB + REPOSITORY TAG IMAGE ID CREATED SIZE + debian bullseye 4eacea30377a 8 days ago 124MB + debian latest 4eacea30377a 8 days ago 124MB ``` Docker uses a content-addressable image store, and the image ID is a SHA256 digest covering the image's configuration and layers. In the example above, - `debian:jessie` and `debian:latest` have the same image ID because they are - actually the *same* image tagged with different names. Because they are the - same image, their layers are stored only once and do not consume extra disk - space. + `debian:bullseye` and `debian:latest` have the same image ID because they are + the *same* image tagged with different names. Because they are the same image, + their layers are stored only once and do not consume extra disk space. For more information about images, layers, and the content-addressable store, refer to [understand images, containers, and storage drivers](https://docs.docker.com/storage/storagedriver/). @@ -130,8 +129,8 @@ examples: |- So far, you've pulled images by their name (and "tag"). Using names and tags is a convenient way to work with images. When using tags, you can `docker pull` an image again to make sure you have the most up-to-date version of that image. - For example, `docker pull ubuntu:20.04` pulls the latest version of the Ubuntu - 20.04 image. + For example, `docker pull ubuntu:22.04` pulls the latest version of the Ubuntu + 22.04 image. In some cases you don't want images to be updated to newer versions, but prefer to use a fixed version of an image. Docker enables you to pull an image by its @@ -140,23 +139,23 @@ examples: |- and guarantee that the image you're using is always the same. To know the digest of an image, pull the image first. Let's pull the latest - `ubuntu:20.04` image from Docker Hub: + `ubuntu:22.04` image from Docker Hub: ```console - $ docker pull ubuntu:20.04 + $ docker pull ubuntu:22.04 - 20.04: Pulling from library/ubuntu - 16ec32c2132b: Pull complete - Digest: sha256:82becede498899ec668628e7cb0ad87b6e1c371cb8a1e597d83a47fac21d6af3 - Status: Downloaded newer image for ubuntu:20.04 - docker.io/library/ubuntu:20.04 + 22.04: Pulling from library/ubuntu + 125a6e411906: Pull complete + Digest: sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d + Status: Downloaded newer image for ubuntu:22.04 + docker.io/library/ubuntu:22.04 ``` Docker prints the digest of the image after the pull has finished. In the example above, the digest of the image is: ```console - sha256:82becede498899ec668628e7cb0ad87b6e1c371cb8a1e597d83a47fac21d6af3 + sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d ``` Docker also prints the digest of an image when *pushing* to a registry. This @@ -166,25 +165,25 @@ examples: |- pull the above image by digest, run the following command: ```console - $ docker pull ubuntu@sha256:82becede498899ec668628e7cb0ad87b6e1c371cb8a1e597d83a47fac21d6af3 + $ docker pull ubuntu@sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d - docker.io/library/ubuntu@sha256:82becede498899ec668628e7cb0ad87b6e1c371cb8a1e597d83a47fac21d6af3: Pulling from library/ubuntu - Digest: sha256:82becede498899ec668628e7cb0ad87b6e1c371cb8a1e597d83a47fac21d6af3 - Status: Image is up to date for ubuntu@sha256:82becede498899ec668628e7cb0ad87b6e1c371cb8a1e597d83a47fac21d6af3 - docker.io/library/ubuntu@sha256:82becede498899ec668628e7cb0ad87b6e1c371cb8a1e597d83a47fac21d6af3 + docker.io/library/ubuntu@sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d: Pulling from library/ubuntu + Digest: sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d + Status: Image is up to date for ubuntu@sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d + docker.io/library/ubuntu@sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d ``` Digest can also be used in the `FROM` of a Dockerfile, for example: ```dockerfile - FROM ubuntu@sha256:82becede498899ec668628e7cb0ad87b6e1c371cb8a1e597d83a47fac21d6af3 + FROM ubuntu@sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d LABEL org.opencontainers.image.authors="some maintainer " ``` > **Note** > > Using this feature "pins" an image to a specific version in time. - > Docker will therefore not pull updated versions of an image, which may include + > Docker does therefore not pull updated versions of an image, which may include > security updates. If you want to pull an updated image, you need to change the > digest accordingly. @@ -200,7 +199,7 @@ examples: |- listening on port 5000 (`myregistry.local:5000`): ```console - $ docker pull myregistry.local:5000/testing/test-image + $ docker image pull myregistry.local:5000/testing/test-image ``` Registry credentials are managed by [docker login](login.md). @@ -210,39 +209,41 @@ examples: |- [insecure registries](dockerd.md#insecure-registries) section for more information. - ### Pull a repository with multiple images + ### Pull a repository with multiple images (-a, --all-tags) By default, `docker pull` pulls a *single* image from the registry. A repository can contain multiple images. To pull all images from a repository, provide the `-a` (or `--all-tags`) option when using `docker pull`. - This command pulls all images from the `fedora` repository: + This command pulls all images from the `ubuntu` repository: ```console - $ docker pull --all-tags fedora + $ docker image pull --all-tags ubuntu - Pulling repository fedora + Pulling repository ubuntu ad57ef8d78d7: Download complete 105182bb5e8b: Download complete 511136ea3c5a: Download complete 73bd853d2ea5: Download complete .... - Status: Downloaded newer image for fedora + Status: Downloaded newer image for ubuntu ``` - After the pull has completed use the `docker images` command to see the - images that were pulled. The example below shows all the `fedora` images - that are present locally: + After the pull has completed use the `docker image ls` command (or the `docker images` + shorthand) to see the images that were pulled. The example below shows all the + `ubuntu` images that are present locally: ```console - $ docker images fedora - - REPOSITORY TAG IMAGE ID CREATED SIZE - fedora rawhide ad57ef8d78d7 5 days ago 359.3 MB - fedora 20 105182bb5e8b 5 days ago 372.7 MB - fedora heisenbug 105182bb5e8b 5 days ago 372.7 MB - fedora latest 105182bb5e8b 5 days ago 372.7 MB + $ docker image ls --filter reference=ubuntu + REPOSITORY TAG IMAGE ID CREATED SIZE + ubuntu 18.04 c6ad7e71ba7d 5 weeks ago 63.2MB + ubuntu bionic c6ad7e71ba7d 5 weeks ago 63.2MB + ubuntu 22.04 5ccefbfc0416 2 months ago 78MB + ubuntu focal ff0fea8310f3 2 months ago 72.8MB + ubuntu latest ff0fea8310f3 2 months ago 72.8MB + ubuntu jammy 41ba606c8ab9 3 months ago 79MB + ubuntu 20.04 ba6acccedd29 7 months ago 72.8MB ``` ### Cancel a pull @@ -251,21 +252,18 @@ examples: |- running in a terminal, will terminate the pull operation. ```console - $ docker pull fedora + $ docker pull ubuntu Using default tag: latest - latest: Pulling from library/fedora + latest: Pulling from library/ubuntu a3ed95caeb02: Pulling fs layer 236608c7b546: Pulling fs layer ^C ``` - > **Note** - > - > The Engine terminates a pull operation when the connection between the Docker - > Engine daemon and the Docker Engine client initiating the pull is lost. If the - > connection with the Engine daemon is lost for other reasons than a manual - > interaction, the pull is also aborted. + The Engine terminates a pull operation when the connection between the daemon + and the client (initiating the pull) is cut or lost for any reason or the + command is manually terminated. deprecated: false experimental: false experimentalcli: false diff --git a/_data/engine-cli/docker_push.yaml b/_data/engine-cli/docker_push.yaml index 09c47adab1..a9a9e63b47 100644 --- a/_data/engine-cli/docker_push.yaml +++ b/_data/engine-cli/docker_push.yaml @@ -86,7 +86,7 @@ examples: |- You should see both `rhel-httpd` and `registry-host:5000/myadmin/rhel-httpd` listed. - ### Push all tags of an image + ### Push all tags of an image (-a, --all-tags) Use the `-a` (or `--all-tags`) option to push all tags of a local image. diff --git a/_data/engine-cli/docker_rm.yaml b/_data/engine-cli/docker_rm.yaml index 0020d657f7..550d7bf7e8 100644 --- a/_data/engine-cli/docker_rm.yaml +++ b/_data/engine-cli/docker_rm.yaml @@ -46,7 +46,7 @@ examples: |- /redis ``` - ### Remove a link specified with `--link` on the default bridge network + ### Remove a link specified with `--link` on the default bridge network (--link) This removes the underlying link between `/webapp` and the `/redis` containers on the default bridge network, removing all network communication @@ -59,7 +59,7 @@ examples: |- /webapp/redis ``` - ### Force-remove a running container + ### Force-remove a running container (--force) This command force-removes a running container. @@ -102,10 +102,10 @@ examples: |- $ docker ps --filter status=exited -q | xargs docker rm ``` - ### Remove a container and its volumes + ### Remove a container and its volumes (-v, --volumes) ```console - $ docker rm -v redis + $ docker rm --volumes redis redis ``` diff --git a/_data/engine-cli/docker_run.yaml b/_data/engine-cli/docker_run.yaml index 067fff38ef..14b01ef1be 100644 --- a/_data/engine-cli/docker_run.yaml +++ b/_data/engine-cli/docker_run.yaml @@ -8,9 +8,6 @@ long: |- previous changes intact using `docker start`. See `docker ps -a` to view a list of all containers. - The `docker run` command can be used in combination with `docker commit` to - [*change the command that a container runs*](commit.md). There is additional detailed information about `docker run` in the [Docker run reference](../run.md). - For information on connecting a container to a network, see the ["*Docker network overview*"](https://docs.docker.com/network/). usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...] pname: docker @@ -925,7 +922,7 @@ options: kubernetes: false swarm: false examples: |- - ### Assign name and allocate pseudo-TTY (--name, -it) + ### Assign name and allocate pseudo-TTY (--name, -it) ```console $ docker run --name test -it debian @@ -944,7 +941,7 @@ examples: |- `exit 13`. This exit code is passed on to the caller of `docker run`, and is recorded in the `test` container's metadata. - ### Capture container ID (--cidfile) + ### Capture container ID (--cidfile) ```console $ docker run --cidfile /tmp/docker_test.cid ubuntu echo "test" @@ -955,7 +952,7 @@ examples: |- If the file exists already, Docker will return an error. Docker will close this file when `docker run` exits. - ### Full container capabilities (--privileged) + ### Full container capabilities (--privileged) ```console $ docker run -t -i --rm ubuntu bash @@ -980,7 +977,7 @@ examples: |- words, the container can then do almost everything that the host can do. This flag exists to allow special use-cases, like running Docker within Docker. - ### Set working directory (-w) + ### Set working directory (-w, --workdir) ```console $ docker run -w /path/to/dir/ -i -t ubuntu pwd @@ -989,22 +986,22 @@ examples: |- The `-w` lets the command being executed inside directory given, here `/path/to/dir/`. If the path does not exist it is created inside the container. - ### Set storage driver options per container + ### Set storage driver options per container (--storage-opt) ```console $ docker run -it --storage-opt size=120G fedora /bin/bash ``` - This (size) will allow to set the container rootfs size to 120G at creation time. + This (size) will allow to set the container filesystem size to 120G at creation time. This option is only available for the `devicemapper`, `btrfs`, `overlay2`, `windowsfilter` and `zfs` graph drivers. For the `devicemapper`, `btrfs`, `windowsfilter` and `zfs` graph drivers, user cannot pass a size less than the Default BaseFS Size. For the `overlay2` storage driver, the size option is only available if the - backing fs is `xfs` and mounted with the `pquota` mount option. - Under these conditions, user can pass any size less than the backing fs size. + backing filesystem is `xfs` and mounted with the `pquota` mount option. + Under these conditions, user can pass any size less than the backing filesystem size. - ### Mount tmpfs (--tmpfs) + ### Mount tmpfs (--tmpfs) ```console $ docker run -d --tmpfs /run:rw,noexec,nosuid,size=65536k my_image @@ -1013,7 +1010,7 @@ examples: |- The `--tmpfs` flag mounts an empty tmpfs into the container with the `rw`, `noexec`, `nosuid`, `size=65536k` options. - ### Mount volume (-v, --read-only) + ### Mount volume (-v, --read-only) ```console $ docker run -v `pwd`:`pwd` -w `pwd` -i -t ubuntu pwd @@ -1047,8 +1044,8 @@ examples: |- $ docker run -t -i -v /var/run/docker.sock:/var/run/docker.sock -v /path/to/static-docker-binary:/usr/bin/docker busybox sh ``` - By bind-mounting the docker unix socket and statically linked docker - binary (refer to [get the linux binary](https://docs.docker.com/engine/install/binaries/#install-static-binaries)), + By bind-mounting the Docker Unix socket and statically linked Docker + binary (refer to [get the Linux binary](https://docs.docker.com/engine/install/binaries/#install-static-binaries)), you give the container the full access to create and manipulate the host's Docker daemon. @@ -1079,7 +1076,7 @@ examples: |- For in-depth information about volumes, refer to [manage data in containers](https://docs.docker.com/storage/volumes/) - ### Add bind mounts or volumes using the --mount flag + ### Add bind mounts or volumes using the --mount flag The `--mount` flag allows you to mount volumes, host-directories and `tmpfs` mounts in a container. @@ -1087,7 +1084,7 @@ examples: |- The `--mount` flag supports most options that are supported by the `-v` or the `--volume` flag, but uses a different syntax. For in-depth information on the `--mount` flag, and a comparison between `--volume` and `--mount`, refer to - the [service create command reference](service_create.md#add-bind-mounts-volumes-or-memory-filesystems). + [Bind mounts](https://docs.docker.com/storage/bind-mounts/). Even though there is no plan to deprecate `--volume`, usage of `--mount` is recommended. @@ -1101,7 +1098,7 @@ examples: |- $ docker run -t -i --mount type=bind,src=/data,dst=/data busybox sh ``` - ### Publish or expose port (-p, --expose) + ### Publish or expose port (-p, --expose) ```console $ docker run -p 127.0.0.1:80:8080/tcp ubuntu bash @@ -1139,7 +1136,7 @@ examples: |- When creating (and running) a container from an image, the daemon checks if the image exists in the local image cache. If the image is missing, an error is - returned to the cli, allowing it to initiate a pull. + returned to the CLI, allowing it to initiate a pull. The default (`missing`) is to only pull the image if it is not present in the daemon's image cache. This default allows you to run images that only exist @@ -1166,7 +1163,7 @@ examples: |- docker: Error response from daemon: No such image: hello-world:latest. ``` - ### Set environment variables (-e, --env, --env-file) + ### Set environment variables (-e, --env, --env-file) ```console $ docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash @@ -1217,7 +1214,7 @@ examples: |- USER=jonzeolla ``` - ### Set metadata on container (-l, --label, --label-file) + ### Set metadata on container (-l, --label, --label-file) A label is a `key=value` pair that applies metadata to a container. To label a container with two labels: @@ -1259,12 +1256,14 @@ examples: |- metadata in Docker*](https://docs.docker.com/config/labels-custom-metadata/) in the Docker User Guide. - ### Connect a container to a network (--network) + ### Connect a container to a network (--network) When you start a container use the `--network` flag to connect it to a network. - This adds the `busybox` container to the `my-net` network. + The following commands create a network named `my-net`, and adds a `busybox` container + to the `my-net` network. ```console + $ docker network create my-net $ docker run -itd --network=my-net busybox ``` @@ -1285,14 +1284,14 @@ examples: |- > **Note** > - > Service discovery is unavailable on the default bridge network. Containers can - > communicate via their IP addresses by default. To communicate by name, they - > must be linked. + > The default bridge network only allow containers to communicate with each other using + > internal IP addresses. User-created bridge networks provide DNS resolution between + > containers using container names. You can disconnect a container from a network using the `docker network disconnect` command. - ### Mount volumes from container (--volumes-from) + ### Mount volumes from container (--volumes-from) ```console $ docker run --volumes-from 777f7dc92da7 --volumes-from ba8c0c54f0f2:ro -i -t ubuntu pwd @@ -1318,11 +1317,11 @@ examples: |- The `Z` option tells Docker to label the content with a private unshared label. Only the current container can use a private volume. - ### Attach to STDIN/STDOUT/STDERR (-a) + ### Attach to STDIN/STDOUT/STDERR (-a, --attach) - The `-a` flag tells `docker run` to bind to the container's `STDIN`, `STDOUT` - or `STDERR`. This makes it possible to manipulate the output and input as - needed. + The `--attach` (or `-a`) flag tells `docker run` to bind to the container's + `STDIN`, `STDOUT` or `STDERR`. This makes it possible to manipulate the output + and input as needed. ```console $ echo "test" | docker run -i -a stdin ubuntu cat - @@ -1343,13 +1342,15 @@ examples: |- $ cat somefile | docker run -i -a stdin mybuilder dobuild ``` - This is how piping a file into a container could be done for a build. + This is a way of using `--attach` to pipe a build file into a container. The container's ID will be printed after the build is done and the build logs could be retrieved using `docker logs`. This is useful if you need to pipe a file or something else into a container and retrieve the container's ID once the container has finished running. - ### Add host device to container (--device) + See also [the `docker cp` command](cp.md). + + ### Add host device to container (--device) ```console $ docker run -it --rm \ @@ -1442,14 +1443,14 @@ examples: |- > **Note**: initially present devices still need to be explicitly added to the > `docker run` / `docker create` command. - ### Access an NVIDIA GPU + ### Access an NVIDIA GPU The `--gpus` flag allows you to access NVIDIA GPU resources. First you need to install [nvidia-container-runtime](https://nvidia.github.io/nvidia-container-runtime/). Visit [Specify a container's resources](https://docs.docker.com/config/containers/resource_constraints/) for more information. - To use `--gpus`, specify which GPUs (or all) to use. If no value is provied, all + To use `--gpus`, specify which GPUs (or all) to use. If no value is provided, all available GPUs are used. The example below exposes all available GPUs. ```console @@ -1469,7 +1470,7 @@ examples: |- $ docker run -it --rm --gpus '"device=0,2"' nvidia-smi ``` - ### Restart policies (--restart) + ### Restart policies (--restart) Use Docker's `--restart` to specify a container's *restart policy*. A restart policy controls whether the Docker daemon restarts a container after exit. @@ -1493,7 +1494,7 @@ examples: |- [Restart Policies (--restart)](../run.md#restart-policies---restart) section of the Docker run reference page. - ### Add entries to container hosts file (--add-host) + ### Add entries to container hosts file (--add-host) You can add other hosts into a container's `/etc/hosts` file by using one or more `--add-host` flags. This example adds a static address for a host named @@ -1531,7 +1532,7 @@ examples: |- devices, replace `eth0` with the correct device name (for example `docker0` for the bridge device). - ### Set ulimits in container (--ulimit) + ### Set ulimits in container (--ulimit) Since setting `ulimit` settings in a container requires extra privileges not available in the default container, you can set these using the `--ulimit` flag. @@ -1560,7 +1561,7 @@ examples: |- #### For `nproc` usage Be careful setting `nproc` with the `ulimit` flag as `nproc` is designed by Linux to set the - maximum number of processes available to a user, not to a container. For example, start four + maximum number of processes available to a user, not to a container. For example, start four containers with `daemon` user: ```console @@ -1577,7 +1578,7 @@ examples: |- This fails because the caller set `nproc=3` resulting in the first three containers using up the three processes quota set for the `daemon` user. - ### Stop container with signal (--stop-signal) + ### Stop container with signal (--stop-signal) The `--stop-signal` flag sets the system call signal that will be sent to the container to exit. This signal can be a signal name in the format `SIG`, @@ -1586,12 +1587,12 @@ examples: |- The default is `SIGTERM` if not specified. - ### Optional security options (--security-opt) + ### Optional security options (--security-opt) On Windows, this flag can be used to specify the `credentialspec` option. The `credentialspec` must be in the format `file://spec.txt` or `registry://keyname`. - ### Stop container with timeout (--stop-timeout) + ### Stop container with timeout (--stop-timeout) The `--stop-timeout` flag sets the number of seconds to wait for the container to stop after sending the pre-defined (see `--stop-signal`) system call signal. @@ -1604,7 +1605,7 @@ examples: |- The default is determined by the daemon, and is 10 seconds for Linux containers, and 30 seconds for Windows containers. - ### Specify isolation technology for container (--isolation) + ### Specify isolation technology for container (--isolation) This option is useful in situations where you are running Docker containers on Windows. The `--isolation=` option sets a container's isolation technology. @@ -1625,8 +1626,8 @@ examples: |- | `hyperv` | Hyper-V hypervisor partition-based isolation. | The default isolation on Windows server operating systems is `process`, and `hyperv` - on Windows client operating systems, such as Windows 10. Process isolation is more - performant, but requires the image to + on Windows client operating systems, such as Windows 10. Process isolation has better + performance, but requires that the image and host use the same kernel version. On Windows server, assuming the default configuration, these commands are equivalent and result in `process` isolation: @@ -1647,7 +1648,7 @@ examples: |- PS C:\> docker run -d --isolation hyperv microsoft/nanoserver powershell echo hyperv ``` - ### Specify hard limits on memory available to containers (-m, --memory) + ### Specify hard limits on memory available to containers (-m, --memory) These parameters always set an upper limit on the memory available to the container. On Linux, this is set on the cgroup and applications in a container can query it at `/sys/fs/cgroup/memory/memory.limit_in_bytes`. @@ -1685,7 +1686,7 @@ examples: |- ``` - ### Configure namespaced kernel parameters (sysctls) at runtime + ### Configure namespaced kernel parameters (sysctls) at runtime (--sysctl) The `--sysctl` sets namespaced kernel parameters (sysctls) in the container. For example, to turn on IP forwarding in the containers diff --git a/_data/engine-cli/docker_search.yaml b/_data/engine-cli/docker_search.yaml index e7b82b5a47..31dd1730a1 100644 --- a/_data/engine-cli/docker_search.yaml +++ b/_data/engine-cli/docker_search.yaml @@ -76,7 +76,7 @@ examples: |- marclop/busybox-solr ``` - ### Display non-truncated description (--no-trunc) + ### Display non-truncated description (--no-trunc) This example displays images with a name containing 'busybox', at least 3 stars and the description isn't truncated in the output: @@ -90,12 +90,12 @@ examples: |- radial/busyboxplus Full-chain, Internet enabled, busybox made from scratch. Comes in git and cURL flavors. 8 [OK] ``` - ### Limit search results (--limit) + ### Limit search results (--limit) The flag `--limit` is the maximum number of results returned by a search. This value could be in the range between 1 and 100. The default value of `--limit` is 25. - ### Filtering + ### Filtering (--filter) The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more than one filter, then pass multiple flags (e.g. `--filter is-automated=true --filter stars=3`) @@ -145,7 +145,7 @@ examples: |- busybox Busybox base image. 325 [OK] ``` - ### Format the output + ### Format the output (--format) The formatting option (`--format`) pretty-prints search output using a Go template. diff --git a/_data/engine-cli/docker_secret_create.yaml b/_data/engine-cli/docker_secret_create.yaml index ffedb1b8ff..f58aa284c5 100644 --- a/_data/engine-cli/docker_secret_create.yaml +++ b/_data/engine-cli/docker_secret_create.yaml @@ -70,7 +70,7 @@ examples: |- dg426haahpi5ezmkkj5kyl3sn my_secret 7 seconds ago 7 seconds ago ``` - ### Create a secret with labels + ### Create a secret with labels (--label) ```console $ docker secret create \ diff --git a/_data/engine-cli/docker_secret_inspect.yaml b/_data/engine-cli/docker_secret_inspect.yaml index 0e21f0ce08..b62135b9bf 100644 --- a/_data/engine-cli/docker_secret_inspect.yaml +++ b/_data/engine-cli/docker_secret_inspect.yaml @@ -79,7 +79,7 @@ examples: |- ] ``` - ### Formatting + ### Format the output (--format) You can use the --format option to obtain specific information about a secret. The following example command outputs the creation time of the diff --git a/_data/engine-cli/docker_secret_ls.yaml b/_data/engine-cli/docker_secret_ls.yaml index 5fd6473acf..fd63d8a023 100644 --- a/_data/engine-cli/docker_secret_ls.yaml +++ b/_data/engine-cli/docker_secret_ls.yaml @@ -53,7 +53,7 @@ examples: |- mem02h8n73mybpgqjf0kfi1n0 test_secret 3 seconds ago 3 seconds ago ``` - ### Filtering + ### Filtering (--filter) The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) @@ -113,7 +113,7 @@ examples: |- mem02h8n73mybpgqjf0kfi1n0 test_secret About an hour ago About an hour ago ``` - ### Format the output + ### Format the output (--format) The formatting option (`--format`) pretty prints secrets output using a Go template. diff --git a/_data/engine-cli/docker_service_create.yaml b/_data/engine-cli/docker_service_create.yaml index a994bc1bb6..feff327953 100644 --- a/_data/engine-cli/docker_service_create.yaml +++ b/_data/engine-cli/docker_service_create.yaml @@ -687,7 +687,7 @@ examples: |- a8q9dasaafud redis2 global 1/1 redis:3.0.6 ``` - #### Create a service using an image on a private registry + #### Create a service using an image on a private registry (--with-registry-auth) If your image is available on a private registry which requires login, use the `--with-registry-auth` flag with `docker service create`, after logging in. If @@ -707,7 +707,7 @@ examples: |- service is deployed, using the encrypted WAL logs. With this information, the nodes are able to log into the registry and pull the image. - ### Create a service with 5 replica tasks (--replicas) + ### Create a service with 5 replica tasks (--replicas) Use the `--replicas` flag to set the number of replica tasks for a replicated service. The following command creates a `redis` service with `5` replica tasks: @@ -743,7 +743,7 @@ examples: |- 4cdgfyky7ozw redis replicated 5/5 redis:3.0.7 ``` - ### Create a service with secrets + ### Create a service with secrets (--secret) Use the `--secret` flag to give a container access to a [secret](secret_create.md). @@ -775,7 +775,7 @@ examples: |- example above, two files are created: `/run/secrets/ssh` and `/run/secrets/app` for each of the secret targets specified. - ### Create a service with configs + ### Create a service with configs (--config) Use the `--config` flag to give a container access to a [config](config_create.md). @@ -804,7 +804,7 @@ examples: |- target is specified, the name of the config is used as the name of the file in the container. If a target is specified, that is used as the filename. - ### Create a service with a rolling update policy + ### Create a service with a rolling update policy ```console $ docker service create \ @@ -820,7 +820,7 @@ examples: |- refer to the [rolling updates tutorial](https://docs.docker.com/engine/swarm/swarm-tutorial/rolling-update/). - ### Set environment variables (-e, --env) + ### Set environment variables (-e, --env) This sets an environment variable for all tasks in a service. For example: @@ -844,7 +844,7 @@ examples: |- redis:3.0.6 ``` - ### Create a service with specific hostname (--hostname) + ### Create a service with specific hostname (--hostname) This option sets the docker service containers hostname to a specific string. For example: @@ -853,7 +853,7 @@ examples: |- $ docker service create --name redis --hostname myredis redis:3.0.6 ``` - ### Set metadata on a service (-l, --label) + ### Set metadata on a service (-l, --label) A label is a `key=value` pair that applies metadata to a service. To label a service with two labels: @@ -861,7 +861,7 @@ examples: |- ```console $ docker service create \ --name redis_2 \ - --label com.example.foo="bar" + --label com.example.foo="bar" \ --label bar=baz \ redis:3.0.6 ``` @@ -869,7 +869,7 @@ examples: |- For more information about labels, refer to [apply custom metadata](https://docs.docker.com/config/labels-custom-metadata/). - ### Add bind mounts, volumes or memory filesystems + ### Add bind mounts, volumes or memory filesystems (--mount) Docker supports three different kinds of mounts, which allow containers to read from or write to files or directories, either on the host operating system, or @@ -1232,7 +1232,7 @@ examples: |- redis:3.0.6 ``` - ### Specify service constraints (--constraint) + ### Specify service constraints (--constraint) You can limit the set of nodes where a task can be scheduled by defining constraint expressions. Constraint expressions can either use a _match_ (`==`) @@ -1248,7 +1248,7 @@ examples: |- | `node.platform.os` | Node operating system | `node.platform.os==windows` | | `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` | | `node.labels` | User-defined node labels | `node.labels.security==high` | - | `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-14.04` | + | `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-22.04` | `engine.labels` apply to Docker Engine labels like operating system, drivers, etc. Swarm administrators add `node.labels` for operational purposes by using @@ -1299,7 +1299,7 @@ examples: |- b6lww17hrr4e web replicated 1/1 nginx:alpine ``` - ### Specify service placement preferences (--placement-pref) + ### Specify service placement preferences (--placement-pref) You can set up the service to divide tasks evenly over different categories of nodes. One example of where this can be useful is to balance tasks over a set @@ -1370,7 +1370,7 @@ examples: |- `--placement-pref-rm` removes an existing placement preference that matches the argument. - ### Specify memory requirements and constraints for a service (--reserve-memory and --limit-memory) + ### Specify memory requirements and constraints for a service (--reserve-memory and --limit-memory) If your service needs a minimum amount of memory in order to run correctly, you can use `--reserve-memory` to specify that the service should only be @@ -1438,7 +1438,7 @@ examples: |- host at the level of the host operating system, using `cgroups` or other relevant operating system tools. - ### Specify maximum replicas per node (--replicas-max-per-node) + ### Specify maximum replicas per node (--replicas-max-per-node) Use the `--replicas-max-per-node` flag to set the maximum number of replica tasks that can run on a node. The following command creates a nginx service with 2 replica tasks but only one replica task per node. @@ -1458,7 +1458,7 @@ examples: |- nginx ``` - ### Attach a service to an existing network (--network) + ### Attach a service to an existing network (--network) You can use overlay networks to connect one or more services within the swarm. @@ -1495,7 +1495,7 @@ examples: |- Long form syntax of `--network` allows to specify list of aliases and driver options: `--network name=my-network,alias=web1,driver-opt=field1=value1` - ### Publish service ports externally to the swarm (-p, --publish) + ### Publish service ports externally to the swarm (-p, --publish) You can publish service ports to make them available externally to the swarm using the `--publish` flag. The `--publish` flag can take two different styles @@ -1566,7 +1566,7 @@ examples: |- the long syntax. For more information refer to [Use swarm mode routing mesh](https://docs.docker.com/engine/swarm/ingress/). - ### Provide credential specs for managed service accounts (Windows only) + ### Provide credential specs for managed service accounts (--credentials-spec) This option is only used for services using Windows containers. The `--credential-spec` must be in the format `file://` or @@ -1661,7 +1661,7 @@ examples: |- x3ti0erg11rjpg64m75kej2mz-hosttempl ``` - ### Specify isolation mode (Windows) + ### Specify isolation mode on Windows (--isolation) By default, tasks scheduled on Windows nodes are run using the default isolation mode configured for this particular node. To force a specific isolation mode, you can use @@ -1676,7 +1676,7 @@ examples: |- - `process`: use process isolation (Windows server only) - `hyperv`: use Hyper-V isolation - ### Create services requesting Generic Resources + ### Create services requesting Generic Resources (--generic-resources) You can narrow the kind of nodes your task can land on through the using the `--generic-resource` flag (if the nodes advertise these resources): diff --git a/_data/engine-cli/docker_service_inspect.yaml b/_data/engine-cli/docker_service_inspect.yaml index 346c9db0bd..e0aed46b0c 100644 --- a/_data/engine-cli/docker_service_inspect.yaml +++ b/_data/engine-cli/docker_service_inspect.yaml @@ -115,7 +115,7 @@ examples: |- ] ``` - ### Formatting + ### Formatting (--pretty) You can print the inspect output in a human-readable format instead of the default JSON output, by using the `--pretty` option: @@ -148,9 +148,9 @@ examples: |- You can also use `--format pretty` for the same effect. + ### Format the output (--format) - #### Find the number of tasks running as part of a service - + You can use the --format option to obtain specific information about a The `--format` option can be used to obtain specific information about a service. For example, the following command outputs the number of replicas of the "redis" service. diff --git a/_data/engine-cli/docker_service_ls.yaml b/_data/engine-cli/docker_service_ls.yaml index 960293d0ab..484bc60b5b 100644 --- a/_data/engine-cli/docker_service_ls.yaml +++ b/_data/engine-cli/docker_service_ls.yaml @@ -59,7 +59,7 @@ examples: |- additionally show the completion status of the job as completed tasks over total tasks the job will execute. - ### Filtering + ### Filtering (--filter) The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) @@ -131,7 +131,7 @@ examples: |- 0bcjwfh8ychr redis replicated 1/1 redis:3.0.6 ``` - ### Formatting + ### Format the output (--format) The formatting options (`--format`) pretty-prints services output using a Go template. diff --git a/_data/engine-cli/docker_service_ps.yaml b/_data/engine-cli/docker_service_ps.yaml index 05bce66933..d2d50beaa4 100644 --- a/_data/engine-cli/docker_service_ps.yaml +++ b/_data/engine-cli/docker_service_ps.yaml @@ -118,7 +118,7 @@ examples: |- nvjljf7rmor4htv7l8rwcx7i7 \_ redis.2 redis:3.0.6@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842 worker2 Shutdown Rejected 5 minutes ago "No such image: redis@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842" ``` - ### Filtering + ### Filtering (--filter) The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`). @@ -175,7 +175,7 @@ examples: |- The `desired-state` filter can take the values `running`, `shutdown`, or `accepted`. - ### Formatting + ### Format the output (--format) The formatting options (`--format`) pretty-prints tasks output using a Go template. diff --git a/_data/engine-cli/docker_service_update.yaml b/_data/engine-cli/docker_service_update.yaml index 150fcf64cf..41422b558e 100644 --- a/_data/engine-cli/docker_service_update.yaml +++ b/_data/engine-cli/docker_service_update.yaml @@ -841,7 +841,7 @@ examples: |- $ docker service update --limit-cpu 2 redis ``` - ### Perform a rolling restart with no parameter changes + ### Perform a rolling restart with no parameter changes ```console $ docker service update --force --update-parallelism 1 --update-delay 30s redis @@ -854,7 +854,7 @@ examples: |- `--update-delay 30s` setting introduces a 30 second delay between tasks, so that the rolling restart happens gradually. - ### Add or remove mounts + ### Add or remove mounts (--mount-add, --mount-rm) Use the `--mount-add` or `--mount-rm` options add or remove a service's bind mounts or volumes. @@ -866,7 +866,7 @@ examples: |- service name. - The `--mount-add` flag takes the same parameters as the `--mount` flag on - `service create`. Refer to the [volumes and bind mounts](service_create.md#add-bind-mounts-volumes-or-memory-filesystems) + `service create`. Refer to the [volumes and bind mounts](service_create.md#mount) section in the `service create` reference for details. - The `--mount-rm` flag takes the `target` path of the mount. @@ -890,11 +890,11 @@ examples: |- myservice ``` - ### Add or remove published service ports + ### Add or remove published service ports (--publish-add, --publish-rm) Use the `--publish-add` or `--publish-rm` flags to add or remove a published port for a service. You can use the short or long syntax discussed in the - [docker service create](service_create.md#publish-service-ports-externally-to-the-swarm--p---publish) + [docker service create](service_create.md#publish) reference. The following example adds a published service port to an existing service. @@ -905,11 +905,11 @@ examples: |- myservice ``` - ### Add or remove network + ### Add or remove network (--network-add, --network-rm) Use the `--network-add` or `--network-rm` flags to add or remove a network for a service. You can use the short or long syntax discussed in the - [docker service create](service_create.md#attach-a-service-to-an-existing-network---network) + [docker service create](service_create.md#network) reference. The following example adds a new alias name to an existing service already connected to network my-network: @@ -921,7 +921,7 @@ examples: |- myservice ``` - ### Roll back to the previous version of a service + ### Roll back to the previous version of a service (--rollback) Use the `--rollback` option to roll back to the previous version of the service. @@ -987,7 +987,7 @@ examples: |- tasks at a time will get rolled back. These rollback parameters are respected both during automatic rollbacks and for rollbacks initiated manually using `--rollback`. - ### Add or remove secrets + ### Add or remove secrets (--secret-add, --secret-rm) Use the `--secret-add` or `--secret-rm` options add or remove a service's secrets. @@ -1007,7 +1007,7 @@ examples: |- See [`service create`](service_create.md#create-services-using-templates) for the reference. - ### Specify isolation mode (Windows) + ### Specify isolation mode on Windows (--isolation) `service update` supports the same `--isolation` flag as `service create` See [`service create`](service_create.md) for the reference. diff --git a/_data/engine-cli/docker_stack_deploy.yaml b/_data/engine-cli/docker_stack_deploy.yaml index e5c42b6d3d..64a86f8edc 100644 --- a/_data/engine-cli/docker_stack_deploy.yaml +++ b/_data/engine-cli/docker_stack_deploy.yaml @@ -81,7 +81,7 @@ inherited_options: kubernetes: false swarm: false examples: |- - ### Compose file + ### Compose file (--compose-file) The `deploy` command supports compose file version `3.0` and above. diff --git a/_data/engine-cli/docker_stack_ls.yaml b/_data/engine-cli/docker_stack_ls.yaml index c2ebc8ff53..41e59e0fe2 100644 --- a/_data/engine-cli/docker_stack_ls.yaml +++ b/_data/engine-cli/docker_stack_ls.yaml @@ -68,7 +68,7 @@ examples: |- vossibility-stack 6 Swarm ``` - ### Formatting + ### Format the output (--format) The formatting option (`--format`) pretty-prints stacks using a Go template. diff --git a/_data/engine-cli/docker_stack_ps.yaml b/_data/engine-cli/docker_stack_ps.yaml index bf870e8d37..74f19ef86a 100644 --- a/_data/engine-cli/docker_stack_ps.yaml +++ b/_data/engine-cli/docker_stack_ps.yaml @@ -102,7 +102,7 @@ examples: |- t72q3z038jeh voting_redis.2 redis:alpine node3 Running Running 3 minutes ago ``` - ### Filtering + ### Filtering (--filter) The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`). @@ -171,7 +171,7 @@ examples: |- t72q3z038jeh voting_redis.2 redis:alpine node3 Running Running 21 minutes ago ``` - ### Formatting + ### Format the output (--format) The formatting options (`--format`) pretty-prints tasks output using a Go template. @@ -208,7 +208,7 @@ examples: |- voting_redis.2: redis:alpine ``` - ### Do not map IDs to Names + ### Do not map IDs to Names (--no-resolve) The `--no-resolve` option shows IDs for task name, without mapping IDs to Names. @@ -226,7 +226,7 @@ examples: |- t72q3z038jeh tg61x8myx563ueo3urmn1ic6m.2 redis:alpine kanqcxfajd1r16wlnqcblobmm Running Running 31 minutes ago ``` - ### Do not truncate output + ### Do not truncate output (--no-trunc) When deploying a service, docker resolves the digest for the service's image, and pins the service to that digest. The digest is not shown by @@ -247,7 +247,7 @@ examples: |- t72q3z038jehe1wbh9gdum076 voting_redis.2 redis:alpine@sha256:9cd405cd1ec1410eaab064a1383d0d8854d1ef74a54e1e4a92fb4ec7bdc3ee7 node3 Running Runnin 32 minutes ago ``` - ### Only display task IDs + ### Only display task IDs (-q, --quiet) The `-q ` or `--quiet` option only shows IDs of the tasks in the stack. This example outputs all task IDs of the "voting" stack; diff --git a/_data/engine-cli/docker_stack_services.yaml b/_data/engine-cli/docker_stack_services.yaml index 3035330b31..718e09f9a2 100644 --- a/_data/engine-cli/docker_stack_services.yaml +++ b/_data/engine-cli/docker_stack_services.yaml @@ -76,7 +76,7 @@ examples: |- dn7m7nhhfb9y myapp_db 1/1 mysql@sha256:a9a5b559f8821fe73d58c3606c812d1c044868d42c63817fa5125fd9d8b7b539 ``` - ### Filtering + ### Filtering (--filter) The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`). @@ -113,7 +113,7 @@ examples: |- * Swarm: not supported * Kubernetes: supported - ### Formatting + ### Format the output (--format) The formatting options (`--format`) pretty-prints services output using a Go template. diff --git a/_data/engine-cli/docker_stats.yaml b/_data/engine-cli/docker_stats.yaml index 99c0aaa376..34fa3e0981 100644 --- a/_data/engine-cli/docker_stats.yaml +++ b/_data/engine-cli/docker_stats.yaml @@ -81,7 +81,7 @@ examples: |- 4bda148efbc0 random.1.vnc8on831idyr42slu578u3cr 0.00% 1.672MiB / 1.952GiB 0.08% 110kB / 0B 578kB / 0B 2 ``` - If you don't [specify a format string using `--format`](#formatting), the + If you don't [specify a format string using `--format`](#format), the following columns are shown. | Column name | Description | @@ -149,7 +149,7 @@ examples: |- 9db7aa4d986d mad_wilson 9.59% 40.09 MiB 27.6 kB / 8.81 kB 17 MB / 20.1 MB ``` - ### Formatting + ### Format the output (--format) The formatting option (`--format`) pretty prints container output using a Go template. diff --git a/_data/engine-cli/docker_swarm_ca.yaml b/_data/engine-cli/docker_swarm_ca.yaml index 09c54f39ae..199e1489e2 100644 --- a/_data/engine-cli/docker_swarm_ca.yaml +++ b/_data/engine-cli/docker_swarm_ca.yaml @@ -128,7 +128,7 @@ examples: |- -----END CERTIFICATE----- ``` - ### `--rotate` + ### Root CA rotation (--rotate) Root CA Rotation is recommended if one or more of the swarm managers have been compromised, so that those managers can no longer connect to or be trusted by @@ -151,7 +151,7 @@ examples: |- see if any nodes are down or otherwise unable to rotate TLS certificates. - ### `--detach` + ### Run root CA rotation in detached mode (--detach) Initiate the root CA rotation, but do not wait for the completion of or display the progress of the rotation. diff --git a/_data/engine-cli/docker_system_events.yaml b/_data/engine-cli/docker_system_events.yaml index 5f07232a06..590218642f 100644 --- a/_data/engine-cli/docker_system_events.yaml +++ b/_data/engine-cli/docker_system_events.yaml @@ -19,6 +19,7 @@ long: |- - `die` - `exec_create` - `exec_detach` + - `exec_die` - `exec_start` - `export` - `health_status` @@ -97,7 +98,7 @@ long: |- seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a fraction of a second no more than nine digits long. - #### Filtering + #### Filtering (--filter) The filtering flag (`-f` or `--filter`) format is of "key=value". If you would like to use multiple filters, pass multiple flags (e.g., @@ -122,16 +123,6 @@ long: |- * plugin (`plugin=`) * type (`type=`) * volume (`volume=`) - - #### Format - - If a format (`--format`) is specified, the given template will be executed - instead of the default - format. Go's [text/template](https://golang.org/pkg/text/template/) package - describes all the details of the format. - - If a format is set to `{{json .}}`, the events are streamed as valid JSON - Lines. For information about JSON Lines, please refer to https://jsonlines.org/ . usage: docker system events [OPTIONS] pname: docker system plink: docker_system.yaml @@ -306,8 +297,8 @@ examples: |- $ docker system events --filter 'container=container_1' --filter 'container=container_2' - 2014-09-03T15:49:29.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04) - 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04) + 2014-09-03T15:49:29.999999999Z07:00 container die 4386fb97867d (image=ubuntu:22.04 ) + 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu:22.04 ) 2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (imager=redis:2.8) 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8) @@ -329,7 +320,11 @@ examples: |- 2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest) ``` - ### Format the output + ### Format the output (--format) + + If a format (`--format`) is specified, the given template will be executed + instead of the default format. Go's [text/template](https://golang.org/pkg/text/template/) + package describes all the details of the format. ```console $ docker system events --filter 'type=container' --format 'Type={{.Type}} Status={{.Status}} ID={{.ID}}' @@ -344,6 +339,9 @@ examples: |- #### Format as JSON + If a format is set to `{{json .}}`, the events are streamed as valid JSON + Lines. For information about JSON Lines, please refer to https://jsonlines.org/ . + ```console $ docker system events --format '{{json .}}' diff --git a/_data/engine-cli/docker_system_prune.yaml b/_data/engine-cli/docker_system_prune.yaml index 3a724d965f..2a1f78ba42 100644 --- a/_data/engine-cli/docker_system_prune.yaml +++ b/_data/engine-cli/docker_system_prune.yaml @@ -117,7 +117,7 @@ examples: |- Total reclaimed space: 13.5 MB ``` - ### Filtering + ### Filtering (--filter) The filtering flag (`--filter`) format is of "key=value". If there is more than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) diff --git a/_data/engine-cli/docker_update.yaml b/_data/engine-cli/docker_update.yaml index 5a8509a499..c44066c55c 100644 --- a/_data/engine-cli/docker_update.yaml +++ b/_data/engine-cli/docker_update.yaml @@ -163,7 +163,7 @@ options: examples: |- The following sections illustrate ways to use this command. - ### Update a container's cpu-shares + ### Update a container's cpu-shares (--cpu-shares) To limit a container's cpu-shares to 512, first identify the container name or ID. You can use `docker ps` to find these values. You can also @@ -173,7 +173,7 @@ examples: |- $ docker update --cpu-shares 512 abebf7571666 ``` - ### Update a container with cpu-shares and memory + ### Update a container with cpu-shares and memory (-m, --memory) To update multiple resource configurations for multiple containers: @@ -181,7 +181,7 @@ examples: |- $ docker update --cpu-shares 512 -m 300M abebf7571666 hopeful_morse ``` - ### Update a container's kernel memory constraints + ### Update a container's kernel memory constraints (--kernel-memory) You can update a container's kernel memory limit using the `--kernel-memory` option. On kernel version older than 4.6, this option can be updated on a @@ -218,7 +218,7 @@ examples: |- Kernel version newer than (include) 4.6 does not have this limitation, you can use `--kernel-memory` the same way as other options. - ### Update a container's restart policy + ### Update a container's restart policy (--restart) You can change a container's restart policy on a running container. The new restart policy takes effect instantly after you run `docker update` on a diff --git a/_data/engine-cli/docker_version.yaml b/_data/engine-cli/docker_version.yaml index dd9b0e9b1e..197174170c 100644 --- a/_data/engine-cli/docker_version.yaml +++ b/_data/engine-cli/docker_version.yaml @@ -1,11 +1,101 @@ command: docker version short: Show the Docker version information long: |- - By default, this will render all version information in an easy to read - layout. If a format is specified, the given template will be executed instead. + The version command prints the current version number for all independently + versioned Docker components. Use the [`--format`](#format) option to customize + the output. - Go's [text/template](https://golang.org/pkg/text/template/) package - describes all the details of the format. + The version command (`docker version`) outputs the version numbers of Docker + components, while the `--version` flag (`docker --version`) outputs the version + number of the Docker CLI you are using. + + ### Default output + + The default output renders all version information divided into two sections; + the "Client" section contains information about the Docker CLI and client + components, and the "Server" section contains information about the Docker + Engine and components used by the Engine, such as the "Containerd" and "Runc" + OCI Runtimes. + + The information shown may differ depending on how you installed Docker and + what components are in use. The following example shows the output on a macOS + machine running Docker Desktop: + + ```console + $ docker version + + Client: + Version: 20.10.16 + API version: 1.41 + Go version: go1.17.10 + Git commit: aa7e414 + Built: Thu May 12 09:17:28 2022 + OS/Arch: darwin/amd64 + Context: default + + Server: Docker Desktop 4.8.2 (77141) + Engine: + Version: 20.10.16 + API version: 1.41 (minimum version 1.12) + Go version: go1.17.10 + Git commit: f756502 + Built: Thu May 12 09:15:33 2022 + OS/Arch: linux/amd64 + Experimental: false + containerd: + Version: 1.6.4 + GitCommit: 212e8b6fa2f44b9c21b2798135fc6fb7c53efc16 + runc: + Version: 1.1.1 + GitCommit: v1.1.1-0-g52de29d + docker-init: + Version: 0.19.0 + GitCommit: de40ad0 + ``` + + ### Client and server versions + + Docker uses a client/server architecture, which allows you to use the Docker CLI + on your local machine to control a Docker Engine running on a remote machine, + which can be (for example) a machine running in the Cloud or inside a Virtual Machine. + + The following example switches the Docker CLI to use a [context](context.md) + named "remote-test-server", which runs an older version of the Docker Engine + on a Linux server: + + ```console + $ docker context use remote-test-server + remote-test-server + + $ docker version + + Client: + Version: 20.10.16 + API version: 1.40 (downgraded from 1.41) + Go version: go1.17.10 + Git commit: aa7e414 + Built: Thu May 12 09:17:28 2022 + OS/Arch: darwin/amd64 + Context: remote-test-server + + Server: Docker Engine - Community + Engine: + Version: 19.03.8 + API version: 1.40 (minimum version 1.12) + Go version: go1.12.17 + Git commit: afacb8b + Built: Wed Mar 11 01:29:16 2020 + OS/Arch: linux/amd64 + containerd: + Version: v1.2.13 + GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429 + runc: + Version: 1.0.0-rc10 + GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd + docker-init: + Version: 0.18.0 + GitCommit: fec3683 + ``` usage: docker version [OPTIONS] pname: docker plink: docker.yaml @@ -28,47 +118,19 @@ options: kubernetes: true swarm: false examples: |- - ### Default output + ### Format the output (--format) - ```console - $ docker version - - Client: - Version: 19.03.8 - API version: 1.40 - Go version: go1.12.17 - Git commit: afacb8b - Built: Wed Mar 11 01:21:11 2020 - OS/Arch: darwin/amd64 - Context: default - Experimental: true - - Server: - Engine: - Version: 19.03.8 - API version: 1.40 (minimum version 1.12) - Go version: go1.12.17 - Git commit: afacb8b - Built: Wed Mar 11 01:29:16 2020 - OS/Arch: linux/amd64 - Experimental: true - containerd: - Version: v1.2.13 - GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429 - runc: - Version: 1.0.0-rc10 - GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd - docker-init: - Version: 0.18.0 - GitCommit: fec3683 - ``` + The formatting option (`--format`) pretty-prints the output using a Go template, + which allows you to customize the output format, or to obtain specific information + from the output. Refer to the [format command and log output](https://docs.docker.com/config/formatting/) + page for details of the format. ### Get the server version ```console $ docker version --format '{{.Server.Version}}' - 19.03.8 + 20.10.16 ``` ### Dump raw JSON data diff --git a/_data/engine-cli/docker_volume_create.yaml b/_data/engine-cli/docker_volume_create.yaml index 720764b596..c38a4725e8 100644 --- a/_data/engine-cli/docker_volume_create.yaml +++ b/_data/engine-cli/docker_volume_create.yaml @@ -72,7 +72,7 @@ examples: |- If you specify a volume name already in use on the current driver, Docker assumes you want to re-use the existing volume and does not return an error. - ### Driver-specific options + ### Driver-specific options (-o, --opt) Some volume drivers may take options to customize the volume creation. Use the `-o` or `--opt` flags to pass driver options: diff --git a/_data/engine-cli/docker_volume_inspect.yaml b/_data/engine-cli/docker_volume_inspect.yaml index fc70b3008b..3fcc4af7fb 100644 --- a/_data/engine-cli/docker_volume_inspect.yaml +++ b/_data/engine-cli/docker_volume_inspect.yaml @@ -48,6 +48,8 @@ examples: |- ] ``` + ### Format the output (--format) + Use the `--format` flag to format the output using a Go template, for example, to print the `Mountpoint` property: diff --git a/_data/engine-cli/docker_volume_ls.yaml b/_data/engine-cli/docker_volume_ls.yaml index 4a691f0655..0a1dd059e7 100644 --- a/_data/engine-cli/docker_volume_ls.yaml +++ b/_data/engine-cli/docker_volume_ls.yaml @@ -3,7 +3,7 @@ aliases: list short: List volumes long: |- List all the volumes known to Docker. You can filter using the `-f` or - `--filter` flag. Refer to the [filtering](#filtering) section for more + `--filter` flag. Refer to the [filtering](#filter) section for more information about available filter options. usage: docker volume ls [OPTIONS] pname: docker volume @@ -55,7 +55,7 @@ examples: |- local tyler ``` - ### Filtering + ### Filtering (--filter) The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) @@ -155,7 +155,7 @@ examples: |- local rosemary ``` - ### Formatting + ### Format the output (--format) The formatting options (`--format`) pretty-prints volumes output using a Go template. diff --git a/_data/engine-cli/docker_volume_prune.yaml b/_data/engine-cli/docker_volume_prune.yaml index 12bec840e2..69d04e7ff3 100644 --- a/_data/engine-cli/docker_volume_prune.yaml +++ b/_data/engine-cli/docker_volume_prune.yaml @@ -36,6 +36,20 @@ examples: |- Total reclaimed space: 36 B ``` + + ### Filtering (--filter) + + The filtering flag (`--filter`) format is of "key=value". If there is more + than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) + + The currently supported filters are: + + * label (`label=`, `label==`, `label!=`, or `label!==`) - only remove volumes with (or without, in case `label!=...` is used) the specified labels. + + The `label` filter accepts two formats. One is the `label=...` (`label=` or `label==`), + which removes volumes with the specified labels. The other + format is the `label!=...` (`label!=` or `label!==`), which removes + volumes without the specified labels. deprecated: false min_api_version: "1.25" experimental: false diff --git a/_data/samples.yaml b/_data/samples.yaml index 91fc0d2a7d..1479632263 100644 --- a/_data/samples.yaml +++ b/_data/samples.yaml @@ -313,8 +313,8 @@ samples: - javascript - nginx - postgresql - - title: k8s-wordsmith-demo - url: https://github.com/dockersamples/k8s-wordsmith-demo + - title: wordsmith + url: https://github.com/dockersamples/wordsmith description: A demo app that runs three containers, including PostgreSQL, Java, and Go. dev_env: false services: diff --git a/_data/toc.yaml b/_data/toc.yaml index 1baf89e6c7..4fb01257a7 100644 --- a/_data/toc.yaml +++ b/_data/toc.yaml @@ -125,6 +125,8 @@ guides: path: /language/dotnet/run-containers/ - title: "Develop your app" path: /language/dotnet/develop/ + - title: "Run your tests" + path: /language/dotnet/run-tests/ - title: "Configure CI/CD" path: /language/dotnet/configure-ci-cd/ - title: "Deploy your app" @@ -844,7 +846,7 @@ reference: path: /docker-hub/api/deprecated/ - title: Registry API path: /registry/spec/api/ - - sectiontitle: Docker Extension SDK API (Beta) + - sectiontitle: Docker Extension SDK API section: - path: /desktop/extensions-sdk/dev/api/reference/interfaces/DesktopUI/ title: DesktopUI @@ -902,8 +904,6 @@ reference: title: Compose file build - path: /compose/compose-file/deploy/ title: Compose file deploy - - path: /compose/faq/ - title: Frequently asked questions - sectiontitle: Legacy versions section: - path: /compose/compose-file/compose-versioning/ @@ -1161,17 +1161,17 @@ manuals: title: Distribute your dev environment - path: /desktop/dev-environments/dev-cli/ title: Use the docker dev CLI plugin - - sectiontitle: Extensions (Beta) + - sectiontitle: Extensions section: - path: /desktop/extensions/ title: What are Docker Extensions? - path: /desktop/extensions/marketplace/ - title: Manage marketplace Extensions + title: Manage Marketplace extensions - path: /desktop/extensions/non-marketplace/ title: Manage non-Marketplace extensions - path: /desktop/extensions/settings-feedback/ - title: Change Settings and give feedback - - sectiontitle: Extensions SDK (Beta) + title: Change settings and give feedback + - sectiontitle: Extensions SDK section: - path: /desktop/extensions-sdk/ title: Overview @@ -1183,7 +1183,7 @@ manuals: section: - title: Create a simple extension path: /desktop/extensions-sdk/build/minimal-frontend-extension/ - - title: Create a more advanced frontend + - title: Create an advanced frontend extension path: /desktop/extensions-sdk/build/frontend-extension-tutorial/ - title: Add a backend to your extension path: /desktop/extensions-sdk/build/backend-extension-tutorial/ @@ -1645,6 +1645,18 @@ manuals: title: Build contexts and linking targets - path: /build/bake/compose-file/ title: Building from Compose file + - sectiontitle: Attestations + section: + - path: /build/attestations/ + title: Overview + - path: /build/attestations/sbom/ + title: SBOM + - path: /build/attestations/slsa-provenance/ + title: Provenance + - path: /build/attestations/slsa-definitions/ + title: SLSA definitions + - path: /build/attestations/attestation-storage/ + title: Attestation storage - sectiontitle: BuildKit section: - path: /build/buildkit/ @@ -1665,6 +1677,8 @@ manuals: title: Overview - path: /compose/features-uses/ title: Key features and use cases + - path: /compose/compose-v2/ + title: Evolution of Compose - sectiontitle: Install Docker Compose section: - path: /compose/install/ @@ -1677,12 +1691,7 @@ manuals: title: Uninstall Compose - path: /compose/gettingstarted/ title: Try Docker Compose - - sectiontitle: Compose V2 - section: - - path: /compose/compose-v2/ - title: Overview - - path: /compose/cli-command-compatibility/ - title: Compose v2 compatibility + - sectiontitle: Environment variables section: - path: /compose/environment-variables/ @@ -1705,6 +1714,8 @@ manuals: title: Control startup order - path: /compose/samples-for-compose/ title: Sample apps with Compose + - path: /compose/faq/ + title: FAQs - path: /compose/release-notes/ title: Release notes diff --git a/_includes/build-feature-state.md b/_includes/build-feature-state.md new file mode 100644 index 0000000000..2a1f01e222 --- /dev/null +++ b/_includes/build-feature-state.md @@ -0,0 +1,2 @@ +> This feature is supported in BuildKit version `{{ include.buildkit_v }}` +> and Buildx version `{{ include.buildx_v }}`. diff --git a/_includes/deploy.md b/_includes/deploy.md index 026e90452a..a67a3020fa 100644 --- a/_includes/deploy.md +++ b/_includes/deploy.md @@ -1,18 +1,18 @@ -Now, that we have configured a CI/CD pipleline, let's look at how we can deploy the application. Docker supports deploying containers on Azure ACI and AWS ECS. You can also deploy your application to Kubernetes if you have enabled Kubernetes in Docker Desktop. +Now that we have configured a CI/CD pipeline, let's look at how we can deploy the application. Docker supports deploying containers on Azure ACI and AWS ECS. You can also deploy your application to Kubernetes if you have enabled Kubernetes in Docker Desktop. ## Docker and Azure ACI -The Docker Azure Integration enables developers to use native Docker commands to run applications in Azure Container Instances (ACI) when building cloud-native applications. The new experience provides a tight integration between Docker Desktop and Microsoft Azure allowing developers to quickly run applications using the Docker CLI or VS Code extension, to switch seamlessly from local development to cloud deployment. +The Docker Azure Integration enables developers to use native Docker commands to run applications in Azure Container Instances (ACI) when building cloud-native applications. The new experience provides a tight integration between Docker Desktop and Microsoft Azure allowing developers to quickly run applications using the Docker CLI or VS Code extension to switch seamlessly from local development to cloud deployment. For detailed instructions, see [Deploying Docker containers on Azure](/cloud/aci-integration/). ## Docker and AWS ECS -The Docker ECS Integration enables developers to use native Docker commands in Docker Compose CLI to run applications in Amazon EC2 Container Service (ECS) when building cloud-native applications. +The Docker ECS Integration enables developers to use native Docker commands in the Docker Compose CLI to run applications in an Amazon EC2 Container Service (ECS) when building cloud-native applications. -The integration between Docker and Amazon ECS allows developers to use the Docker Compose CLI to set up an AWS context in one Docker command, allowing you to switch from a local context to a cloud context and run applications quickly and easily simplify multi-container application development on Amazon ECS using Compose files. +The integration between Docker and Amazon ECS allows developers to use the Docker Compose CLI to set up an AWS context in one Docker command, allowing them to switch from a local context to a cloud context and run applications quickly and easily to simplify multi-container application development on Amazon ECS using Compose files. For detailed instructions, see [Deploying Docker containers on ECS](/cloud/ecs-integration/). @@ -22,7 +22,7 @@ Docker Desktop includes a standalone Kubernetes server and client, as well as Do To enable Kubernetes: -1. From the Docker menu, select **Preferences** (**Settings** on Windows). +1. From the Docker menu, select **Settings**. 2. Select **Kubernetes** and click **Enable Kubernetes**. This starts a Kubernetes single-node cluster when Docker Desktop starts. diff --git a/_includes/desktop-install.html b/_includes/desktop-install.html index f3282e4241..555c4eb9f0 100644 --- a/_includes/desktop-install.html +++ b/_includes/desktop-install.html @@ -13,7 +13,7 @@ Download file

- Checksum: SHA-256 04dbd937971f1940e22f1edab9cad90722268b3f98feb77140535e1ac64606a8 + Checksum: SHA-256 20e4ba05b573610506b57a7f216115458019d2c002f18ef6d50a2419b7db545b @@ -31,7 +31,7 @@ Download file

- Checksum: SHA-256 bee41d646916e579b16b7fae014e2fb5e5e7b5dbaf7c1949821fd311d3ce430b + Checksum: SHA-256 22eecb8ea07f10892d81cde07d614fb8b342163106133a75c4280a8e28787643 @@ -49,7 +49,7 @@ Download file

- Checksum: SHA-256 fc8609d57fb8c8264122f581c0f66497e46e171f8027d85d90213527d6226362 + Checksum: SHA-256 838eabe6cc42fe7e4be2cdb4d73924c61fc7982366dac2a9467793845851cb2e @@ -64,10 +64,10 @@
- Download file + Download file

- Checksum: SHA-256 744266c6adef23e0823facded844f3b879fd0a988f8604f9b620d7585f249cf9 + Checksum: SHA-256 fa3023eb16c24dcbdc5f12021340e874d8399863e96c1a58091c9a41fd50fe58
@@ -82,10 +82,10 @@
- Download file + Download file

- Checksum: SHA-256 84e206c3e4742d37c7ef7d3d7440c5a085e1a4a77da2c628d133324a3f77f891 + Checksum: SHA-256 7f54f29a971b9ba456e7aef777d747867d7e4eccb7a2b47aa9092c99a990f8d5
@@ -100,10 +100,10 @@
- Download file + Download file

- Checksum: SHA-256 43156553268ccc8cb11eef08ac375c90af60ccdc65ae407bdf100ff2e50c6867 + Checksum: SHA-256 05e94709974e711bf81aa16845ebba976f8236a371432594c87a68ecf9a21d0f
diff --git a/_includes/desktop-update.md b/_includes/desktop-update.md index 66afae80f2..914739727e 100644 --- a/_includes/desktop-update.md +++ b/_includes/desktop-update.md @@ -1,6 +1,6 @@ -When an update is available, Docker Desktop displays an icon on the Docker menu to indicate the availability of a newer version. Additionally, the **Software Updates** section in **Settings** (**Preferences** on Mac) also notifies you of any updates available to Docker Desktop. You can choose to download the update right away, or click the **Release Notes** option to learn what's included in the updated version. +When an update is available, Docker Desktop displays an icon on the Docker menu to indicate the availability of a newer version. Additionally, the **Software Updates** section in **Settings** also notifies you of any updates available to Docker Desktop. You can choose to download the update right away, or click the **Release Notes** option to learn what's included in the updated version. Starting with Docker Desktop 4.2.0, the option to turn off the automatic check for updates is available for users on all Docker subscriptions, including Docker Personal and Docker Pro.. diff --git a/_includes/dev-envs-changing.md b/_includes/dev-envs-changing.md new file mode 100644 index 0000000000..823d42faf6 --- /dev/null +++ b/_includes/dev-envs-changing.md @@ -0,0 +1,6 @@ +> **Dev Environments is changing** +> +>We’re working hard to make Dev Environments work even better for you and your teams. In the coming months, we’ll be introducing a new vision for Dev Environments. +> +>In the mean time, it may take us longer to respond to requests for support. +{: .important} \ No newline at end of file diff --git a/_includes/eula-modal.html b/_includes/eula-modal.html index 3673066579..f00705cb2f 100644 --- a/_includes/eula-modal.html +++ b/_includes/eula-modal.html @@ -27,4 +27,4 @@ - + diff --git a/_includes/extensions-form.md b/_includes/extensions-form.md new file mode 100644 index 0000000000..75269467db --- /dev/null +++ b/_includes/extensions-form.md @@ -0,0 +1,3 @@ +> Already built an extension? +> +> Let us know about your experience using the [feedback form](https://docs.docker.com/feedback/extension/). \ No newline at end of file diff --git a/_includes/head.html b/_includes/head.html index 2fc71c8e40..4e448bd56a 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -69,6 +69,7 @@ + {%- endif -%} {%- if site.local_search -%} diff --git a/_includes/image-modal.html b/_includes/image-modal.html new file mode 100644 index 0000000000..099bd3ce51 --- /dev/null +++ b/_includes/image-modal.html @@ -0,0 +1,5 @@ +
+ × + / +
+
diff --git a/_includes/install-script.md b/_includes/install-script.md index c17f903211..4146fef790 100644 --- a/_includes/install-script.md +++ b/_includes/install-script.md @@ -34,12 +34,12 @@ of the convenience script: > Tip: preview script steps before running > -> You can run the script with the `DRY_RUN=1` option to learn what steps the +> You can run the script with the `--dry-run` option to learn what steps the > script will run when invoked: > > ```console > $ curl -fsSL https://get.docker.com -o get-docker.sh -> $ DRY_RUN=1 sudo sh ./get-docker.sh +> $ sudo sh ./get-docker.sh --dry-run > ``` This example downloads the script from diff --git a/_layouts/docs.html b/_layouts/docs.html index 64d85aed15..cca1d264e8 100644 --- a/_layouts/docs.html +++ b/_layouts/docs.html @@ -52,6 +52,8 @@ {%- assign my_min = page.toc_min | default: site.toc_min | default: 2 -%} {%- assign my_max = page.toc_max | default: site.toc_max | default: 3 -%} {%- assign my_name = page.url | default: "unnamed" -%} +
Contents:
+ {% include image-modal.html %}
Page details