3242 Commits

Author SHA1 Message Date
Paweł Gronowski
22bd59010e hack: Fix dockerversion not being set correctly
Replace old package name with moby/v2

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-08-04 16:35:48 +02:00
Paweł Gronowski
79148460b0 hack/make.ps1: Replace old package name with moby/v2
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-08-04 16:35:47 +02:00
Cory Snider
ee560a3b23 api/types: fix Plugin.Config.Interface.Types def'n
The wire type of Plugin.Config.Interface.Types is an array of strings,
not of objects with three properties. We just so happen to have a Go
struct type to represent a plugin-interface-type value in memory with
all the fields parsed out for convenience, but that is not part of the
REST API contract documented by the Swager spec.U pdate the Swagger spec
to correctly document that the Types property is an array of strings in
the API, while still generating Go definitions that unmarshal into the
convenient struct type.

Move the definition and marshal/unmarshal methods for
PluginInterfaceType into a more appropriate location than api/types.
Rename the type to one that does not stutter or overload already
heavily overloaded terminology.

Modernize the parser and use property-based testing to assert that it
behaves the same as the old parser for all well-formed inputs.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-08-01 13:37:20 -04:00
Cory Snider
2783f80ecf api/types: generate with latest go-swagger
Override some of the templates to suppress emitting unwanted validation
and marshal/unmarshal code.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-08-01 13:30:23 -04:00
Sebastiaan van Stijn
c98e5cb60b update github links to moby/moby
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-01 01:48:55 +02:00
Derek McGowan
83357620e2 Update unit test script for windows
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-31 10:49:03 -07:00
Derek McGowan
900a0516de Update hack/test/unit for go module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-31 10:49:02 -07:00
Derek McGowan
1d571e619d Rename build package to moby v2 module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-31 10:49:02 -07:00
Derek McGowan
65867642d3 Remove go module workarounds
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-31 10:49:02 -07:00
Sebastiaan van Stijn
01c7b4233c hack/validate: remove obsolete exception
This was added in 20d594fb79, but was
written before the API module was added. Now that the API is a separate
module, the check will no longer flag packages importing the API.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-23 01:35:00 +02:00
Sebastiaan van Stijn
20d594fb79 deprecate pkg/stdcopy, move to api/stdcopy
The stdcopy package is used to produce and read multiplexed streams for
"attach" and "logs". It is used both by the API server (to produce), and
the client (to read / de-multiplex).

Move it to the api package, so that it can be included in the api module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-21 21:41:39 +02:00
Derek McGowan
135cea2a10 Update test-unit for client module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-21 09:29:26 -07:00
Derek McGowan
7e708a5416 Update unit tests for api module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-21 09:29:26 -07:00
Derek McGowan
0971099c5f Add options to vendor to add and remove replace
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-21 09:29:25 -07:00
Derek McGowan
eab076f217 Gocompat tests no longer needed with go modules
These tests don't account well for submodules and are not needed when
importers are using go modules. The tests are still relevant in the 28
branch which does not use go modules.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-21 09:29:18 -07:00
Sebastiaan van Stijn
1cc42643ae hack/buildkit-ref: temporarily bump BuildKit to head of v0.23 branch
To skip some flaky tests on Windows

diff: https://github.com/moby/buildkit/compare/v0.23.2...dd2b4e18663c58ac3762d7b60b2c3301f71d5fa9

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 15:06:15 +02:00
Rob Murray
8c79486dab Merge pull request #50357 from robmry/firewall_backend_option
Add daemon option --firewall-backend
2025-07-17 19:21:12 +01:00
Rob Murray
39ab393274 Add daemon option --firewall-backend
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-07-17 15:12:01 +01:00
Sebastiaan van Stijn
22ed8b1327 hack/make/test-docker-py: split test-exclusions to separate lines
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-14 18:25:30 +02:00
Paweł Gronowski
0a047e825c update to go1.24.5
- https://github.com/golang/go/issues?q=milestone%3AGo1.24.5+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.24.4...go1.24.5

This minor releases include 1 security fixes following the security policy:

- cmd/go: unexpected command execution in untrusted VCS repositories

    Various uses of the Go toolchain in untrusted VCS repositories can result in
    unexpected code execution. When using the Go toolchain in directories fetched
    using various VCS tools (such as directly cloning Git or Mercurial repositories)
    can cause the toolchain to execute unexpected commands, if said directory
    contains multiple VCS configuration metadata (such as a '.hg' directory in a Git
    repository). This is due to how the Go toolchain attempts to resolve which VCS
    is being used in order to embed build information in binaries and determine
    module versions.

    The toolchain will now abort attempting to resolve which VCS is being used if it
    detects multiple VCS configuration metadata in a module directory or nested VCS
    configuration metadata (such as a '.git' directoy in a parent directory and a
    '.hg' directory in a child directory). This will not prevent the toolchain from
    building modules, but will result in binaries omitting VCS related build
    information.

    If this behavior is expected by the user, the old behavior can be re-enabled by
    setting GODEBUG=allowmultiplevcs=1. This should only be done in trusted
    repositories.

    Thanks to RyotaK (https://ryotak.net) of GMO Flatt Security Inc for reporting
    this issue.

    This is CVE-2025-4674 and https://go.dev/issue/74380.

View the release notes for more information:
https://go.dev/doc/devel/release#go1.24.5

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-07-08 19:21:37 +02:00
CrazyMax
e7289e7e02 hack: check windows resources are set in the binary
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-26 17:03:32 +02:00
Kevin Alvarez
0ea20c9f72 cmd: fix winresources and move them out cli package
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-26 15:56:23 +02:00
CrazyMax
fcf666f9b0 dockerfile: update govulncheck to v1.1.4
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-23 10:02:38 +02:00
Paweł Gronowski
1603ad636e update to go1.24.4
- https://github.com/golang/go/issues?q=milestone%3AGo1.24.4+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.24.3...go1.24.4

This release includes 3 security fixes following the security policy:

- net/http: sensitive headers not cleared on cross-origin redirect

    Proxy-Authorization and Proxy-Authenticate headers persisted on cross-origin redirects potentially leaking sensitive information.

    Thanks to Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.) for reporting this issue.

    This is CVE-2025-4673 and Go issue https://go.dev/issue/73816.

- os: inconsistent handling of O_CREATE|O_EXCL on Unix and Windows

    os.OpenFile(path, os.O_CREATE|O_EXCL) behaved differently on Unix and Windows systems when the target path was a dangling symlink. On Unix systems, OpenFile with O_CREATE and O_EXCL flags never follows symlinks. On Windows, when the target path was a symlink to a nonexistent location, OpenFile would create a file in that location.

    OpenFile now always returns an error when the O_CREATE and O_EXCL flags are both set and the target path is a symlink.

    Thanks to Junyoung Park and Dong-uk Kim of KAIST Hacking Lab for discovering this issue.

    This is CVE-2025-0913 and Go issue https://go.dev/issue/73702.

- crypto/x509: usage of ExtKeyUsageAny disables policy validation

    Calling Verify with a VerifyOptions.KeyUsages that contains ExtKeyUsageAny unintentionally disabledpolicy validation. This only affected certificate chains which contain policy graphs, which are rather uncommon.

    Thanks to Krzysztof Skrzętnicki (@Tener) of Teleport for reporting this issue.

    This is CVE-2025-22874 and Go issue https://go.dev/issue/73612.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-06 19:35:32 +02:00
Rob Murray
21a165de23 Use env-var DOCKER_FIREWALL_BACKEND=nftables to enable nftables
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-05-28 09:57:26 +01:00
Sebastiaan van Stijn
4dc961d0e9 image-inspect: remove Config fields that are not part of the image
commit af0cdc36c7 marked these fields as
deprecated and to be removed in API v1.47 (which was targeted for v28.0).
We shipped v1.47 with the v27.2 release, but did not yet remove the erroneous
fields, so the version to deprecate was updated to v1.48 through
3df03d8e66

This patch removes fields that are not part of the image by replacing the
type with the Config struct from the docker image-spec.

    curl -s --unix-socket /var/run/docker.sock http://localhost/v1.50/images/alpine/json | jq .Config
    {
      "Env": [
        "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
      ],
      "Cmd": [
        "/bin/sh"
      ]
    }

    curl -s --unix-socket /var/run/docker.sock http://localhost/v1.49/images/alpine/json | jq .Config
    {
      "Hostname": "",
      "Domainname": "",
      "User": "",
      "AttachStdin": false,
      "AttachStdout": false,
      "AttachStderr": false,
      "Tty": false,
      "OpenStdin": false,
      "StdinOnce": false,
      "Env": [
        "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
      ],
      "Cmd": [
        "/bin/sh"
      ],
      "Image": "",
      "Volumes": null,
      "WorkingDir": "",
      "Entrypoint": null,
      "OnBuild": null,
      "Labels": null
    }

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-26 17:14:37 +02:00
Sebastiaan van Stijn
7130cd4f16 Remove DockerSchema1RegistrySuite schema 2 version 1 tests
Also remove the DOCKER_ALLOW_SCHEMA1_PUSH_DONOTUSE from Jenkins

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 18:00:06 +02:00
Sebastiaan van Stijn
1cf7d7ea4b hack/make/.binary: update link to go source for "pie" support
Keeping it up to date, in case the situation changes.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-12 10:31:24 +02:00
Sebastiaan van Stijn
e991c7185d update to go1.24.3
release notes: https://go.dev/doc/go1.24

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-12 10:31:00 +02:00
Rob Murray
4b9092aa27 Load br-netfilter for rootless test-integration
If kernel module br_netfilter isn't loaded on the test host
before rootless test-integration tests that need it, the
rootless daemon hits a permission error when trying to do
the load. So, try to load the module before going rootless.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-05-09 17:31:38 +01:00
ChengyuZhu6
91f6e00ffa hack: Update broken links from README
Update referencesin hack/README.md from outdated docker URLs to the correct location at /docs/contributing/test.md.

Signed-off-by: ChengyuZhu6 <hudson@cyzhu.com>
2025-04-28 18:57:05 +08:00
Paweł Gronowski
fb2983ab0d Merge pull request #49677 from vvoland/integration-cli-bump-cli
integration-cli: Update default CLI version to v18.06.3-ce
2025-04-11 10:32:36 +00:00
Paweł Gronowski
fab94808f5 integration-cli: Update default CLI version to v18.06.3-ce
This updates the Docker CLI version used for integration-cli tests from
v17.06.2-ce to v18.06.3-ce.

v18.06 is the first one that supports enabling BuildKit.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-04-10 11:39:13 +02:00
Derek McGowan
cd89a35ea0 Run CLI tests with cgroups v2
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-04-09 11:05:14 -07:00
Sebastiaan van Stijn
74b71c41ac update to go1.23.8 (fix CVE-2025-22871)
full diff: https://github.com/golang/go/compare/go1.23.7...go1.23.8
release notes: https://go.dev/doc/devel/release#go1.24.2

go1.23.8 (released 2025-04-01) includes security fixes to the net/http package,
as well as bug fixes to the runtime and the go command. See the Go 1.23.8
milestone on our issue tracker for details;

https://github.com/golang/go/issues?q=milestone%3AGo1.23.8+label%3ACherryPickApproved

From the mailing list:

Hello gophers,

We have just released Go versions 1.24.2 and 1.23.8, minor point releases.
These minor releases include 1 security fixes following the security policy:

- net/http: request smuggling through invalid chunked data
  The net/http package accepted data in the chunked transfer encoding
  containing an invalid chunk-size line terminated by a bare LF.
  When used in conjunction with a server or proxy which incorrectly
  interprets a bare LF in a chunk extension as part of the extension,
  this could permit request smuggling.
  The net/http package now rejects chunk-size lines containing a bare LF.
  Thanks to Jeppe Bonde Weikop for reporting this issue.
  This is CVE-2025-22871 and Go issue https://go.dev/issue/71988.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-03 12:30:00 +02:00
Rob Murray
adfed82ab8 Install and run firewalld for CI's firewalld tests
The github action running bake expected FIREWALLD to be set, but
DOCKER_FIREWALLD was set instead, so firewalld wasn't installed
in the dev image.

The dind-systemd script expected DOCKER_FIREWALLD to be set if it
needed to run firewalld, and it was. But it had no effect.

In CI, bake builds the image then make runs it - and the use the
same env. So, align on FIREWALLD (as it's not a docker feature).

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-03-28 16:59:48 +00:00
Rob Murray
cea56c1d9c Merge pull request #49671 from robmry/unit_test_with_firewalld
Run systemd/rootless when systemd/rootless unit testing
2025-03-27 08:34:31 +00:00
Paweł Gronowski
8d9e3502ab hack: Fix TestOverlay* test failure in pkg/archive
The pkg/archive/archive_linux_test.go tests create a test archive
content in a temporary directory. This also includes device nodes (using
mknod).
Running these tests in Docker-in-Docker (dind) with systemd was failing
with "operation not permitted" because the rootfs is remounted with
`nodev`.

This change aligns `hack/dind-systemd` with `hack/dind` by
conditionally mounting a `tmpfs` on `/tmp` (with dev enabled),
to make the mknod work.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-03-26 12:11:44 +00:00
Paweł Gronowski
a60603bfa3 hack/validate: Add gocompat
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-03-25 16:10:42 +01:00
Sebastiaan van Stijn
eeee17eaad Dockerfile: update runc binary to v1.2.6
This is the sixth patch release in the 1.2.z series of runc.
It primarily fixes an issue with runc exec vs time namespace,
and a compatibility issue with older kernels.

* Fix a stall issue that would happen if setting `O_CLOEXEC` with
  `CloseExecFrom` failed.
* `runc` now properly handles joining time namespaces (such as with
  `runc exec`). Previously we would attempt to set the time offsets
  when joining, which would fail.
* Handle `EINTR` retries correctly for socket-related direct
  `golang.org/x/sys/unix` system calls.
* We no longer use `F_SEAL_FUTURE_WRITE` when sealing the runc binary, as it
  turns out this had some unfortunate bugs in older kernel versions and was
  never necessary in the first place.
* Remove `Fexecve` helper from `libcontainer/system`. Runc 1.2.1 removed
  runc-dmz, but we forgot to remove this helper added only for that.
* Use Go 1.23 for official builds, run CI with Go 1.24 and drop Ubuntu 20.04
  from CI. We need to drop Ubuntu 20.04 from CI because Github Actions
  announced it's already deprecated and it will be discontinued soon.

full diff: https://github.com/opencontainers/runc/compare/v1.2.5...v1.2.6

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-21 16:54:24 +01:00
Austin Vazquez
35766af7d2 Dockerfile: update containerd binary to v1.7.27
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2025-03-18 15:07:33 +00:00
Paweł Gronowski
8701ff684f Merge pull request #49553 from thaJeztah/bump_containerd_1.7.26
Dockerfile: update containerd binary to v1.7.26
2025-03-12 18:29:55 +00:00
Akihiro Suda
0e54920e01 Dockerfile: update RootlessKit to v2.3.4
https://github.com/rootless-containers/rootlesskit/releases/tag/v2.3.3
https://github.com/rootless-containers/rootlesskit/releases/tag/v2.3.4

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-03-10 11:22:37 +09:00
Sebastiaan van Stijn
0a4c0902a5 Merge pull request #49578 from dmcgowan/update-governance
Update governance and maintainers file
2025-03-07 20:22:55 +01:00
Sebastiaan van Stijn
9278110260 Dockerfile: update containerd binary to v1.7.26
- full diff: https://github.com/containerd/containerd/compare/v1.7.25...v1.7.26
- release notes: https://github.com/containerd/containerd/releases/tag/v1.7.26

Welcome to the v1.7.26 release of containerd!

The twenty-sixth patch release for containerd 1.7 contains various fixes
and updates.

Highlights

- Add support for syncfs after unpack
- Update runc binary to v1.2.55
- Fix race between serve and immediate shutdown on the server
- Reject oversized messages from the sender

Container Runtime Interface (CRI)

- Fix fatal concurrency error in port forwarding

Node Resource Interface (NRI)

- Fix initial sync race when registering NRI plugins
- Add API support for reading Pod IPs
- Fix plugin sync to use multiple messages if ttrpc max message limit is hit
- Update API to pass configured timeouts to plugins.
- Fix mount removal in adjustments
- Close plugin if initial synchronization fails
- Add support for adjusting OOM score
- Add API support for NRI-native CDI injection
- Add support for pids cgroup

Runtime

- Fix console TTY leak in runc shim

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-07 17:47:59 +01:00
Derek McGowan
6e55f83747 Remove unused toml validation
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-03-06 01:44:06 -08:00
Sebastiaan van Stijn
f049fd0533 Merge pull request #49541 from thaJeztah/bump_go_version
update minimum go version to go1.23
2025-03-05 20:36:17 +01:00
Sebastiaan van Stijn
6e8eb8a90f vendor.mod: update minimum go version to go1.23
Go maintainers started to unconditionally update the minimum go version
for golang.org/x/ dependencies to go1.23, which means that we'll no longer
be able to support any version below that when updating those dependencies;

> all: upgrade go directive to at least 1.23.0 [generated]
>
> By now Go 1.24.0 has been released, and Go 1.22 is no longer supported
> per the Go Release Policy (https://go.dev/doc/devel/release#policy).
>
> For golang/go#69095.

This updates our minimum version to go1.23, as we won't be able to maintain
compatibility with older versions because of the above.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-05 13:39:50 +01:00
Paweł Gronowski
5f912e4cf5 update to go1.23.7
- https://github.com/golang/go/issues?q=milestone%3AGo1.23.7+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.23.6...go1.23.7

These minor releases include 1 security fixes following the security policy:

net/http, x/net/proxy, x/net/http/httpproxy: proxy bypass using IPv6 zone IDs

Matching of hosts against proxy patterns could improperly treat an IPv6
zone ID as a hostname component. For example, when the NO_PROXY
environment variable was set to "*.example.com", a request to
"[::1%25.example.com]:80` would incorrectly match and not be proxied.

Thanks to Juho Forsén of Mattermost for reporting this issue.

This is CVE-2025-22870 and Go issue https://go.dev/issue/71984.

View the release notes for more information:
https://go.dev/doc/devel/release#go1.23.7

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-03-04 22:57:35 +01:00
Sebastiaan van Stijn
838ae09a23 Dockerfile: update runc binary to v1.2.5
This is the fifth patch release in the 1.2.z series of runc. It primarily fixes
an issue caused by an upstream systemd bug.

* There was a regression in systemd v230 which made the way we define
  device rule restrictions require a systemctl daemon-reload for our
  transient units. This caused issues for workloads using NVIDIA GPUs.
  Workaround the upstream regression by re-arranging how the unit properties
  are defined.
* Dependency github.com/cyphar/filepath-securejoin is updated to v0.4.1,
  to allow projects that vendor runc to bump it as well.
* CI: fixed criu-dev compilation.
* Dependency golang.org/x/net is updated to 0.33.0.

full diff: https://github.com/opencontainers/runc/compare/v1.2.4...v1.2.5
release notes: https://github.com/opencontainers/runc/releases/tag/v1.2.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-14 10:22:57 +01:00