Commit graph

48958 commits

Author SHA1 Message Date
Sebastiaan van Stijn
4e53936f0a
Merge pull request #47509 from thirdkeyword/master
remove repetitive words
2024-03-06 13:52:16 +01:00
Sebastiaan van Stijn
cb8c8e9631
Merge pull request #47498 from Dzejrou/lower-perm-fix
daemon: overlay2: remove world writable permission from the lower file
2024-03-06 13:09:30 +01:00
Paweł Gronowski
c4fc6c3371
builder-next/executor: Replace removed network.Sample
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-03-06 12:02:12 +01:00
Paweł Gronowski
0f30791a0d
vendor: github.com/moby/buildkit v0.13.0
full diff: https://github.com/moby/buildkit/compare/v0.13.0-rc3...v0.13.0

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-03-06 11:54:43 +01:00
Rob Murray
4e8d9a4522 Add IPv6 nameserver to the internal DNS's upstreams.
When configuring the internal DNS resolver - rather than keep IPv6
nameservers read from the host's resolv.conf in the container's
resolv.conf, treat them like IPv4 addresses and use them as upstream
resolvers.

For IPv6 nameservers, if there's a zone identifier in the address or
the container itself doesn't have IPv6 support, mark the upstream
addresses for use in the host's network namespace.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-03-06 10:47:18 +00:00
Albin Kerouanton
7c7e453255
Merge pull request #47474 from robmry/47441_mac_addr_config_migration
Don't create endpoint config for MAC addr config migration
2024-03-06 11:04:17 +01:00
thirdkeyword
06628e383a remove repetitive words
Signed-off-by: thirdkeyword <fliterdashen@gmail.com>
2024-03-06 18:03:51 +08:00
Sebastiaan van Stijn
4046928978
Merge pull request #47504 from AkihiroSuda/rootlesskit-2.0.2
update RootlessKit to 2.0.2
2024-03-06 10:12:32 +01:00
Albin Kerouanton
21835a5696 inte/networking: rename linkLocal flag into isLinkLocal
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2024-03-06 00:16:08 +01:00
Akihiro Suda
b32cfc3b3a
dockerd-rootless-setuptool.sh: check RootlessKit functionality
RootlessKit will print hints if something is still unsatisfied.

e.g., `kernel.apparmor_restrict_unprivileged_userns` constraint
rootless-containers/rootlesskit@33c3e7ca6c

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-03-06 07:43:00 +09:00
Akihiro Suda
49fd8df9b9
Dockerfile: update RootlessKit to v2.0.2
https://github.com/rootless-containers/rootlesskit/compare/v2.0.1...v2.0.2

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-03-06 07:38:55 +09:00
Akihiro Suda
72ec187dfe
go.mod: github.com/rootless-containers/rootlesskit/v2 v2.0.2
https://github.com/rootless-containers/rootlesskit/compare/v2.0.1...v2.0.2

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-03-06 07:38:00 +09:00
Akihiro Suda
83cda67f73
go.mod: golang.org/x/sys v0.18.0
https://github.com/golang/sys/compare/v0.16.0...v0.18.0

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-03-06 07:37:37 +09:00
Paweł Gronowski
460b4aebdf
Merge pull request #47502 from vvoland/go-1.21.8
update to go1.21.8
2024-03-05 21:58:11 +01:00
Paweł Gronowski
57b7ffa7f6
update to go1.21.8
go1.21.8 (released 2024-03-05) includes 5 security fixes

- crypto/x509: Verify panics on certificates with an unknown public key algorithm (CVE-2024-24783, https://go.dev/issue/65390)
- net/http: memory exhaustion in Request.ParseMultipartForm (CVE-2023-45290, https://go.dev/issue/65383)
- net/http, net/http/cookiejar: incorrect forwarding of sensitive headers and cookies on HTTP redirect (CVE-2023-45289, https://go.dev/issue/65065)
- html/template: errors returned from MarshalJSON methods may break template escaping (CVE-2024-24785, https://go.dev/issue/65697)
- net/mail: comments in display names are incorrectly handled (CVE-2024-24784, https://go.dev/issue/65083)

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

- https://github.com/golang/go/issues?q=milestone%3AGo1.21.8+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.21.7...go1.21.8

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-03-05 19:17:18 +01:00
Jaroslav Jindrak
cadb124ab6
daemon: overlay2: remove world writable permission from the lower file
In de2447c, the creation of the 'lower' file was changed from using
os.Create to using ioutils.AtomicWriteFile, which ignores the system's
umask. This means that even though the requested permission in the
source code was always 0666, it was 0644 on systems with default
umask of 0022 prior to de2447c, so the move to AtomicFile potentially
increased the file's permissions.

This is not a security issue because the parent directory does not
allow writes into the file, but it can confuse security scanners on
Linux-based systems into giving false positives.

Signed-off-by: Jaroslav Jindrak <dzejrou@gmail.com>
2024-03-05 14:25:50 +01:00
Sebastiaan van Stijn
046827c657
Merge pull request #47485 from vvoland/vendor-dns
vendor: github.com/miekg/dns v1.1.57
2024-03-04 11:55:01 +01:00
Sebastiaan van Stijn
04c9d7f6a3
Merge pull request #47465 from vvoland/v26-remove-deprecated
api/search: Reset `is_automated` to false
2024-03-04 11:27:24 +01:00
Paweł Gronowski
b2921509e5
api/search: Reset is_automated field to false
The field will still be present in the response, but will always be
`false`.
Searching for `is-automated=true` will yield no results, while
`is-automated=false` will effectively be a no-op.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-03-04 10:15:59 +01:00
Rob Murray
f04f69e366 Accumulate resolv.conf options
If there are multiple "options" lines, keep the options from all of
them.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-03-01 16:59:28 +00:00
Rob Murray
7f69142aa0 resolv.conf comments have '#' or ';' in the first column
When a '#' or ';' appears anywhere else, it's not a comment marker.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-03-01 16:58:04 +00:00
Sebastiaan van Stijn
97a5435d33
Merge pull request #47477 from robmry/resolvconf_gocompat
Remove slices.Clone() calls to avoid Go bug
2024-03-01 17:28:01 +01:00
Rob Murray
91d9307738 Replace uses of slices.Clone()
Avoid https://github.com/golang/go/issues/64759

Co-authored-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-03-01 15:27:29 +00:00
Paweł Gronowski
12dea3fa9e
devcontainer: Add Golang extension automatically
When using devcontainers in VSCode, install the Go extension
automatically in the container.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-03-01 14:54:35 +01:00
Sebastiaan van Stijn
137a9d6a4c
Merge pull request #47395 from robmry/47370_windows_natnw_dns_test
Test DNS on Windows 'nat' networks
2024-03-01 13:02:52 +01:00
Paweł Gronowski
9f4e824a6e
vendor: github.com/miekg/dns v1.1.57
full diff: https://github.com/github.com/miekg/dns/compare/v1.1.43...v1.1.57

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-03-01 10:14:22 +01:00
Albin Kerouanton
f8e6801533
Merge pull request #47478 from fopina/patch-1
fix typo in error message
2024-03-01 08:53:43 +01:00
Filipe Pina
ef681124ca
fix typo in error message
Signed-off-by: Filipe Pina <hzlu1ot0@duck.com>
2024-02-29 23:27:00 +00:00
Cory Snider
7ebd88d2d9 hack: block imports of vendored testify packages
While github.com/stretchr/testify is not used directly by any of the
repository code, it is a transitive dependency via Swarmkit and
therefore still easy to use without having to revendor. Add lint rules
to ban importing testify packages to make sure nobody does.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2024-02-29 16:20:15 -05:00
Cory Snider
4f30a930ad libn/cnmallocator: migrate tests to gotest.tools/v3
Apply command gotest.tools/v3/assert/cmd/gty-migrate-from-testify to the
cnmallocator package to be consistent with the assertion library used
elsewhere in moby.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2024-02-29 16:14:02 -05:00
Rob Murray
a580544d82 Don't create endpoint config for MAC addr config migration
In a container-create API request, HostConfig.NetworkMode (the identity
of the "main" network) may be a name, id or short-id.

The configuration for that network, including preferred IP address etc,
may be keyed on network name or id - it need not match the NetworkMode.

So, when migrating the old container-wide MAC address to the new
per-endpoint field - it is not safe to create a new EndpointSettings
entry unless there is no possibility that it will duplicate settings
intended for the same network (because one of the duplicates will be
discarded later, dropping the settings it contains).

This change introduces a new API restriction, if the deprecated container
wide field is used in the new API, and EndpointsConfig is provided for
any network, the NetworkMode and key under which the EndpointsConfig is
store must be the same - no mixing of ids and names.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-02-29 17:02:19 +00:00
Sebastiaan van Stijn
b8aa8579ca
Merge pull request #47352 from serhii-nakon/allow_host_loopback
Allow to enable host loopback and use 10.0.2.2 to connect to the host (OPTIONALLY)
2024-02-29 17:58:28 +01:00
Paweł Gronowski
225ccc0cfd
Merge pull request #47473 from vvoland/cli-v26
Dockerfile: Update dev cli to v26.0.0-rc1
2024-02-29 16:02:16 +01:00
Paweł Gronowski
d19d98b136
Merge pull request #47475 from thaJeztah/nothing_to_see_here_move_along_move_along
distribution/xfer: fix pull progress message
2024-02-29 14:46:41 +01:00
Sebastiaan van Stijn
ebf3f8c7fe
distribution/xfer: fix pull progress message
This message accidentally changed in ac2a028dcc
because my IDE's "refactor tool" was a bit over-enthusiastic. It also went and
updated the tests accordingly, so CI didn't catch this :)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-02-29 14:02:55 +01:00
Sebastiaan van Stijn
a242208be3
Merge pull request #47457 from vvoland/ci-report-timeout
ci: Update `teststat` to v0.1.25
2024-02-29 13:39:09 +01:00
Paweł Gronowski
2af2496c8c
Dockerfile: Update dev cli to v26.0.0-rc1
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-02-29 12:45:17 +01:00
Paweł Gronowski
fc0e5401f2
ci: Update teststat to v0.1.25
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-02-29 10:06:07 +01:00
Bjorn Neergaard
8517c3386c
Merge pull request #47458 from vvoland/ci-reports-better-find
ci: Make `find` for test reports more specific
2024-02-29 01:47:07 -07:00
Sebastiaan van Stijn
6c3b3523c9
Merge pull request #47041 from robmry/46968_refactor_resolvconf
Refactor 'resolv.conf' generation.
2024-02-29 09:33:55 +01:00
Bjorn Neergaard
d40b140c08
Merge pull request #47440 from thaJeztah/fix_ping_connection_errs
client: fix connection-errors being shadowed by API version errors
2024-02-28 13:33:49 -07:00
Sebastiaan van Stijn
81428bf11b
Merge pull request #47459 from thaJeztah/disable_schema1
disable pulling legacy image formats by default
2024-02-28 17:12:31 +01:00
Sebastiaan van Stijn
230cb53d3b
Merge pull request #47462 from vvoland/integration-testdaemonproxy-reset-otel
integration: Reset `OTEL_EXPORTER_OTLP_ENDPOINT` for sub-daemons
2024-02-28 17:11:54 +01:00
Cory Snider
7b0ab1011c Vendor dependency cycle-free swarmkit
Moby imports Swarmkit; Swarmkit no longer imports Moby. In order to
accomplish this feat, Swarmkit has introduced a new plugin.Getter
interface so it could stop importing our pkg/plugingetter package. This
new interface is not entirely compatible with our
plugingetter.PluginGetter interface, necessitating a thin adapter.

Swarmkit had to jettison the CNM network allocator to stop having to
import libnetwork as the cnmallocator package is deeply tied to
libnetwork. Move the CNM network allocator into libnetwork, where it
belongs. The package had a short an uninteresting Git history in the
Swarmkit repository so no effort was made to retain history.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2024-02-28 09:46:45 -05:00
Sebastiaan van Stijn
3ca1d751e5
Merge pull request #47461 from vvoland/vendor-buildkit-0.13.0-rc3
vendor: github.com/moby/buildkit v0.13.0-rc3
2024-02-28 14:12:43 +01:00
Sebastiaan van Stijn
589dc5e647
Merge pull request #47456 from huang-jl/fix_restore_digest
libcontainerd: change the digest used when restoring
2024-02-28 14:05:40 +01:00
Sebastiaan van Stijn
62b33a2604
disable pulling legacy image formats by default
This patch disables pulling legacy (schema1 and schema 2, version 1) images by
default.

A `DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE` environment-variable is
introduced to allow re-enabling this feature, aligning with the environment
variable used in containerd 2.0 (`CONTAINERD_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE`).

With this patch, attempts to pull a legacy image produces an error:

With graphdrivers:

    docker pull docker:1.0
    1.0: Pulling from library/docker
    [DEPRECATION NOTICE] Docker Image Format v1, and Docker Image manifest version 2, schema 1 support will be removed in an upcoming release. Suggest the author of docker.io/library/docker:1.0 to upgrade the image to the OCI Format, or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/

With the containerd image store enabled, output is slightly different
as it returns the error before printing the `1.0: pulling ...`:

    docker pull docker:1.0
    Error response from daemon: [DEPRECATION NOTICE] Docker Image Format v1 and Docker Image manifest version 2, schema 1 support is disabled by default and will be removed in an upcoming release. Suggest the author of docker.io/library/docker:1.0 to upgrade the image to the OCI Format or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/

Using the "distribution" endpoint to resolve the digest for an image also
produces an error:

    curl -v --unix-socket /var/run/docker.sock http://foo/distribution/docker.io/library/docker:1.0/json
    *   Trying /var/run/docker.sock:0...
    * Connected to foo (/var/run/docker.sock) port 80 (#0)
    > GET /distribution/docker.io/library/docker:1.0/json HTTP/1.1
    > Host: foo
    > User-Agent: curl/7.88.1
    > Accept: */*
    >
    < HTTP/1.1 400 Bad Request
    < Api-Version: 1.45
    < Content-Type: application/json
    < Docker-Experimental: false
    < Ostype: linux
    < Server: Docker/dev (linux)
    < Date: Tue, 27 Feb 2024 16:09:42 GMT
    < Content-Length: 354
    <
    {"message":"[DEPRECATION NOTICE] Docker Image Format v1, and Docker Image manifest version 2, schema 1 support will be removed in an upcoming release. Suggest the author of docker.io/library/docker:1.0 to upgrade the image to the OCI Format, or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/"}
    * Connection #0 to host foo left intact

Starting the daemon with the `DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE`
env-var set to a non-empty value allows pulling the image;

    docker pull docker:1.0
    [DEPRECATION NOTICE] Docker Image Format v1 and Docker Image manifest version 2, schema 1 support is disabled by default and will be removed in an upcoming release. Suggest the author of docker.io/library/docker:1.0 to upgrade the image to the OCI Format or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/
    b0a0e6710d13: Already exists
    d193ad713811: Already exists
    ba7268c3149b: Already exists
    c862d82a67a2: Already exists
    Digest: sha256:5e7081837926c7a40e58881bbebc52044a95a62a2ea52fb240db3fc539212fe5
    Status: Image is up to date for docker:1.0
    docker.io/library/docker:1.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-02-28 13:57:43 +01:00
Paweł Gronowski
5fe96e234d
integration: Reset OTEL_EXPORTER_OTLP_ENDPOINT for sub-daemons
When creating a new daemon in the `TestDaemonProxy`, reset the
`OTEL_EXPORTER_OTLP_ENDPOINT` to an empty value to disable OTEL
collection to avoid it hitting the proxy.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-02-28 10:48:07 +01:00
Paweł Gronowski
84eecc4a30
Revert "integration/TestDaemonProxy: Remove OTEL span"
This reverts commit 56aeb548b2.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-02-28 10:48:03 +01:00
Paweł Gronowski
261dccc98a
builder-next: Add Info to emptyProvider
To satisfy the `content.InfoReaderProvider` interface.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-02-28 10:20:55 +01:00