Commit Graph

9875 Commits

Author SHA1 Message Date
Sebastiaan van Stijn ca95badb36
Merge pull request #4799 from dvdksn/docs-cdi
docs: add documentation for CDI
2024-01-19 14:15:00 +01:00
David Karlsson aff4649cb7 docs: fix broken links to alias pages
Alias pages redirect to the canonical names, but these pages still
linked to the aliases, causing broken links when building the docs site.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-01-19 14:06:29 +01:00
David Karlsson 852d198bb5 docs: add documentation for CDI
- Add section about cdi-spec-dirs daemon configuration
- Add subsection about cdi in --device section for docker run
- Update `docker info` output example

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-01-18 14:58:43 +01:00
Sebastiaan van Stijn e758fe5a7f
Merge pull request #4795 from thaJeztah/bump_engine
vendor: github.com/docker/docker v25.0.0-rc.3
2024-01-18 10:33:39 +01:00
Sebastiaan van Stijn cdb1c105f6
vendor: github.com/docker/docker v25.0.0-rc.3
full diff: https://github.com/moby/moby/compare/v25.0.0-rc.2...v25.0.0-rc.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-17 23:28:28 +01:00
Sebastiaan van Stijn d161a2a470
Merge pull request #4767 from dvdksn/refresh-plugin-docs
docs(plugins): fix typos and formatting
2024-01-17 14:28:58 +01:00
David Karlsson 3df149545e docs(plugins): fix typos and formatting
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-01-16 20:37:29 +01:00
Sebastiaan van Stijn 33b00e5185
Merge pull request #4797 from dvdksn/daemon-builder-config
docs: add "builder" key to full daemon.json example
2024-01-16 20:34:02 +01:00
David Karlsson 22bbdc7984 docs: add "builder" key to full daemon.json example
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-01-16 20:19:06 +01:00
Sebastiaan van Stijn 5fde1f2b80
Merge pull request #4796 from thaJeztah/deprecate_old_api_versions
deprecate old API versions (1.23 and lower)
2024-01-16 19:42:14 +01:00
Sebastiaan van Stijn 350d6bcc2c
Merge pull request #4792 from laurazard/alternative-fix-no-socket-notif
cli/plugins: use same pgid + skip signal forwarding when attached to a TTY
2024-01-16 18:28:38 +01:00
Sebastiaan van Stijn d2efc5b09c
deprecate old API versions (1.23 and lower)
The Docker daemon provides a versioned API for backward compatibility with old
clients. Docker clients can perform API-version negotiation to select the most
recent API version supported by the daemon (downgrading to and older version of
the API when necessary). API version negotiation was introduced in Docker v1.12.0
(API 1.24), and clients before that used a fixed API version.

Docker Engine versions through v25.0 provide support for all [API versions](https://docs.docker.com/engine/api/#api-version-matrix)
included in stable releases for a given platform. For Docker daemons on Linux,
the earliest supported API version is 1.12 (corresponding with Docker Engine
v1.0.0), whereas for Docker daemons on Windows, the earliest supported API
version is 1.24 (corresponding with Docker Engine v1.12.0).

Support for legacy API versions (providing old API versions on current versions
of the Docker Engine) is primarily intended to provide compatibility with recent,
but still supported versions of the client, which is a common scenario (the Docker
daemon may be updated to the latest release, but not all clients may be up-to-date
or vice versa). Support for API versions before that (API versions provided by
EOL versions of the Docker Daemon) is provided on a "best effort" basis.

Use of old API versions is very rare, and support for legacy API versions
involves significant complexity (Docker 1.0.0 having been released 10 years ago).
Because of this, we'll start deprecating support for legacy API versions.

Docker Engine v25.0 by default disables API version older than 1.24 (aligning
the minimum supported API version between Linux and Windows daemons). When
connecting with a client that uses an API version version older than 1.24,
the daemon returns an error. The following example configures the docker
CLI to use API version 1.23, which produces an error:

    DOCKER_API_VERSION=1.23 docker version
    Error response from daemon: client version 1.23 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version

An environment variable (`DOCKER_MIN_API_VERSION`) is introduced that allows
re-enabling older API versions in the daemon. This environment variable must
be set in the daemon's environment (for example, through a [systemd override
file](https://docs.docker.com/config/daemon/systemd/)), and the specified
API version must be supported by the daemon (`1.12` or higher on Linux, or
`1.24` or higher on Windows).

Support for API versions lower than `1.24` will be permanently removed in Docker
Engine v26, and the minimum supported API version will be incrementally raised
in releases following that.

We do not recommend depending on the `DOCKER_MIN_API_VERSION` environment
variable other than for exceptional cases where it's not possible to update
old clients, and those clients must be supported.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-16 18:13:53 +01:00
Sebastiaan van Stijn a18dad3832
Merge pull request #4755 from dvdksn/cli-reference-canonical
docs: rename reference docs to "object_action"
2024-01-16 15:29:04 +01:00
Laura Brehm 508346ef61
plugins: fix plugin socket being closed before use
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-01-15 15:48:57 +00:00
Sebastiaan van Stijn ca58fdf5a1
Merge pull request #4794 from thaJeztah/ci_update_macos_runner
gha: update to use macos-12 runners
2024-01-15 15:31:39 +01:00
Sebastiaan van Stijn f722e07c62
gha: update to use macos-12 runners
It's the minimum version supported by Docker Desktop

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-15 15:00:09 +01:00
Laura Brehm 5f6c55a724
plugins: don't handle signal/notify if TTY
In order to solve the "double notification" issue (see:
ef5e5fa03f)
without running the plugin process under a new pgid (see:
https://github.com/moby/moby/issues/47073) we instead check if we're
attached to a TTY, and if so skip signalling the plugin process since it
will already be signalled.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-01-15 13:30:17 +00:00
Laura Brehm 26560ff93c
Revert "plugins: run plugin with new process group ID"
This reverts commit ef5e5fa03f.

Running new plugins under a new pgid isn't a viable solution due to
it causing issues with plugin processes attempting to read from the
TTY (see: https://github.com/moby/moby/issues/47073).

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-01-15 13:30:01 +00:00
David Karlsson 37f5515666 docs: fix broken link to tmpfs (missing anchor)
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-01-15 14:16:24 +01:00
David Karlsson b35361e8d2 docs: regenerate stubs for non-canonical commands
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-01-15 13:49:53 +01:00
Sebastiaan van Stijn 67c5a9b6ff
Merge pull request #4791 from vvoland/ci-bin-image-2
ci: Add bin-image workflow (2nd approach)
2024-01-15 13:11:13 +01:00
Sebastiaan van Stijn 9beb0e5f03
Merge pull request #4790 from thaJeztah/bump_x_sys
vendor: golang.org/x/sys v0.16.0
2024-01-15 12:40:05 +01:00
Paweł Gronowski dfa2930afc ci: Add bin-image workflow
Build and push an image containing a static CLI binary for master branch
and every release branch and tag.

This is a slightly adjusted copy of the bin-image workflow from
docker/buildx (by @crazy-max).

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-15 12:05:10 +01:00
Sebastiaan van Stijn 21c2536051
vendor: golang.org/x/sys v0.16.0
full diff: https://github.com/golang/sys/compare/v0.15.0...v0.16.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-15 12:01:27 +01:00
David Karlsson a6774de682 docs: rename cli reference aliases to canonical
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-01-15 11:29:30 +01:00
David Karlsson cf9d3692a3 docs: remove empty cli reference stubs
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-01-15 11:19:39 +01:00
Sebastiaan van Stijn 077d07c4f0
Merge pull request #4771 from thaJeztah/update_engine
vendor: github.com/docker/docker v25.0.0-rc.2
2024-01-15 11:03:40 +01:00
Sebastiaan van Stijn d868dca00f
vendor: github.com/docker/docker v25.0.0-rc.2
- feat: make errdefs.IsXXX helper functions work with wrapped errors

full diff: https://github.com/moby/moby/compare/v25.0.0-rc.1...v25.0.0-rc.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-13 02:08:29 +01:00
Bjorn Neergaard 1fc6ef9d63
Merge pull request #4785 from thaJeztah/revert_bin_image
temporarily revert ci: Add bin-image workflow
2024-01-12 14:46:30 -07:00
Sebastiaan van Stijn 1609916f2c
Revert "Dockerfile/binary: Output the binary directly"
Looks like this change caused docker-ce-packaging to fail;

    dest=$PWD/build/mac; cd /home/ubuntu/workspace/release-packaging_ce-nightly/packaging/src/github.com/docker/cli/build && for platform in *; do \
        arch=$(echo $platform | cut -d_ -f2); \
        mkdir -p $dest/$arch/docker; \
        cp $platform/docker-darwin-* $dest/$arch/docker/docker && \
        tar -C $dest/$arch -c -z -f $dest/$arch/docker-25.0.0-rc.2.tgz docker; \
    done
    cp: cannot stat 'darwin_amd64/docker-darwin-*': No such file or directory
    cp: cannot stat 'darwin_arm64/docker-darwin-*': No such file or directory

This reverts commit 6ad07f2a4b.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-12 22:39:30 +01:00
Sebastiaan van Stijn ff25c4334b
Revert "ci: Add bin-image workflow"
This reverts commit 15d4c99f38.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-12 22:39:05 +01:00
Sebastiaan van Stijn 688de6db16
Merge pull request #4769 from laurazard/signal-handling-fix-tty
plugins: run plugin with new process group ID
2024-01-12 22:06:23 +01:00
Laura Brehm ef5e5fa03f
plugins: run plugin with new process group ID
Changes were made in 1554ac3b5f to provide
a mechanism for the CLI to notify running plugin processes that they
should exit, in order to improve the general CLI/plugin UX. The current
implementation boils down to:
1. The CLI creates a socket
2. The CLI executes the plugin
3. The plugin connects to the socket
4. (When) the CLI receives a termination signal, it uses the socket to
   notify the plugin that it should exit
5. The plugin's gets notified via the socket, and cancels it's `cmd.Context`,
   which then gets handled appropriately

This change works in most cases and fixes the issue it sets out to solve
(see: https://github.com/docker/compose/pull/11292) however, in the case
where the user has a TTY attached and the plugin is not already handling
received signals, steps 4+ changes:
4. (When) the CLI receives a termination signal, before it can use the
   socket to notify the plugin that it should exit, the plugin process
   also receives a signal due to sharing the pgid with the CLI

Since we now have a proper "job control" mechanism, we can simplify the
scenarios by executing the plugins with their own process group id,
thereby removing the "double notification" issue and making it so that
plugins can handle the same whether attached to a TTY or not.

In order to make this change "plugin-binary" backwards-compatible, in
the case that a plugin does not connect to the socket, the CLI passes
the signal to the plugin process.

Co-authored-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2024-01-12 13:53:28 -07:00
Sebastiaan van Stijn ad12276ea0
Merge pull request #4783 from laurazard/fix-no-abstract-sockets
cli-plugins: don't use abstract sockets on macOS
2024-01-12 21:40:06 +01:00
Sebastiaan van Stijn a226502619
Merge pull request #4784 from thaJeztah/vendor_containerd
vendor: github.com/containerd/containerd v1.7.12
2024-01-12 21:14:36 +01:00
Bjorn Neergaard 6d0b329b0d
cli-plugins: use non-abstract socket on darwin
As macOS does not support the abstract socket namespace, use a temporary
socket in $TMPDIR to connect with the plugin. Ensure this socket is
cleaned up even in the case of crash/ungraceful termination by removing
it after the first connection is accepted.

Co-authored-by: Laura Brehm <laurabrehm@hey.com>
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2024-01-12 12:30:27 -07:00
Bjorn Neergaard dbf992f91f
cli-plugins: move socket code into common package
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2024-01-12 11:49:25 -07:00
Sebastiaan van Stijn 8b6ffbdf77
vendor: github.com/containerd/containerd v1.7.12
- full diff: https://github.com/containerd/containerd/compare/v1.7.11...v1.7.12
- release notes: https://github.com/containerd/containerd/releases/tag/v1.7.12

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-12 19:31:12 +01:00
Sebastiaan van Stijn 52b740ac27
Merge pull request #4781 from thaJeztah/bump_buildx_compose
Dockerfile: update buildx to v0.12.1
2024-01-12 18:32:47 +01:00
Sebastiaan van Stijn d469be256e
Merge pull request #4752 from vvoland/ci-bin-image
ci: Add bin-image workflow
2024-01-12 15:50:30 +01:00
Sebastiaan van Stijn ccc7ad2f2c
Dockerfile: update buildx to v0.12.1
Update the version of buildx used in CI to the latest version.

- full diff: https://github.com/docker/buildx/compare/v0.12.0...v0.12.1
- release notes: https://github.com/docker/buildx/releases/tag/v0.12.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-12 15:29:58 +01:00
Sebastiaan van Stijn 708d1136d6
Merge pull request #4782 from thaJeztah/bump_compose
Dockerfile: update docker compose to v2.24.0
2024-01-12 15:29:33 +01:00
Sebastiaan van Stijn fdcb78a0fe
Dockerfile: update docker compose to v2.24.0
Update the version of compose used in CI to the latest version.

- full diff: https://github.com/docker/compose/compare/v2.22.0...v2.24.0
- release notes: https://github.com/docker/compose/releases/tag/v2.24.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-12 14:39:08 +01:00
Paweł Gronowski 15d4c99f38
ci: Add bin-image workflow
Build and push an image containing a static CLI binary for master branch
and every release branch and tag.

This is a slightly adjusted copy of the bin-image workflow from
docker/buildx (by @crazy-max).

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-12 12:28:20 +01:00
Paweł Gronowski ecf338f43b
scripts/build: Handle VERSION containing git ref
Transform `VERSION` variable if it contains a git ref.
This is the same as moby does (with "<<<" bashism removed).

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-12 12:28:18 +01:00
Paweł Gronowski 6ad07f2a4b
Dockerfile/binary: Output the binary directly
`scripts/make/binary` produces `docker` file that is a symlink to a
`docker-<platform>` file.
Make the `binary` Dockerfile target produce an image that only contains
the `docker` binary and not the symlink.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-12 12:28:15 +01:00
Sebastiaan van Stijn 859154b94c
Merge pull request #4778 from thaJeztah/cmd_docker_smaller_interface
cmd/docker: registerCompletionFuncForGlobalFlags: take store.Store as argument
2024-01-11 22:50:47 +01:00
Sebastiaan van Stijn 76e09dd44b
Merge pull request #4777 from thaJeztah/pluginmanager_smaller_interface
cli-plugins/manager: getPluginDirs: take ConfigFile as argument
2024-01-11 22:50:31 +01:00
Sebastiaan van Stijn a745bffb86
Merge pull request #4776 from thaJeztah/fix_shadow
cli-plugins: helloworld: rename var that collided with import
2024-01-11 22:50:12 +01:00
Sebastiaan van Stijn e5d225de16
Merge pull request #4775 from thaJeztah/move_main
cmd/docker: move main() to the top
2024-01-11 22:49:48 +01:00