Commit graph

45410 commits

Author SHA1 Message Date
Bjorn Neergaard
d42495033e
daemon/config: support alternate (common) unicode encodings using a BOM
This is a pragmatic but impure choice, in order to better support the
default tools available on Windows Server, and reduce user confusion due
to otherwise inscrutable-to-the-uninitiated errors like the following:

> invalid character 'þ' looking for beginning of value
> invalid character 'ÿ' looking for beginning of value

While meaningful to those who are familiar with and are equipped to
diagnose encoding issues, these characters will be hidden when the file
is edited with a BOM-aware text editor, and further confuse the user.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-10 15:49:15 -07:00
Bjorn Neergaard
8d1e56e210
CONTRIBUTING.md: drop reference to the Derek GitHub bot
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-10 15:42:09 -07:00
Cory Snider
0867d3173c cmd/dockerd: use default SIGQUIT behaviour
dockerd handles SIGQUIT by dumping all goroutine stacks to standard
error and exiting. In contrast, the Go runtime's default SIGQUIT
behaviour... dumps all goroutine stacks to standard error and exits.
The default SIGQUIT behaviour is implemented directly in the runtime's
signal handler, and so is both more robust to bugs in the Go runtime and
does not perturb the state of the process to anywhere near same degree
as dumping goroutine stacks from a user goroutine. The only notable
difference from a user's perspective is that the process exits with
status 2 instead of 128+SIGQUIT.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-10 17:11:54 -05:00
Bjorn Neergaard
1dcf7d5b03
daemon/config: clean up tests to use common helper
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-10 13:54:17 -07:00
Jan Garcia
1e1d326b50 plugins: Move GlobalSpecPaths into LocalRegistry
Signed-off-by: Jan Garcia <github-public@n-garcia.com>
2023-01-10 21:33:49 +01:00
Cory Snider
62296f9281
Merge pull request #44087 from jchorl/josh/sdkupgrade
Upgrade to aws go sdk v2 for cloudwatch logging driver
2023-01-10 14:51:30 -05:00
Akihiro Suda
cf3ce189ab
Merge pull request #44782 from thaJeztah/no_dockerio
use example.com for tests and examples
2023-01-11 03:31:11 +09:00
Sebastiaan van Stijn
805aea501a
docs: api: synchronise versioned API docs (v1.39 - v1.41)
synchronises some fixes between these API versions for the documentation,
including fixes from:

- 52a9f1689a
- 345346d7c6
- 18f85467e7
- 1557892c37

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 16:42:44 +01:00
Sebastiaan van Stijn
92cbd1c69e
docs: api: synchronise versioned API docs (v1.42)
synchronises some fixes between these API versions for the documentation,
including fixes from:

- 18f85467e7
- 345346d7c6

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 16:42:23 +01:00
Sebastiaan van Stijn
fb80e8a1c4
Merge pull request #44061 from fussybeaver/44059-swagger-create-image-info
api: swagger: add errorDetail to CreateImageInfo
2023-01-10 16:06:43 +01:00
Sebastiaan van Stijn
9275a771bf
Merge pull request #44599 from davidhsingyuchen/doc-auth
docs: add 401 to possible status codes of /auth
2023-01-10 15:39:04 +01:00
Sebastiaan van Stijn
4f81f9d5ea
builder/dockerfile: use example.com for tests
Trying to remove the "docker.io" domain from locations where it's not relevant.
In these cases, this domain was used as a "random" domain for testing or example
purposes.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 15:28:09 +01:00
Sebastiaan van Stijn
65aa43bf66
libnetwork: use example.com for tests and examples
Trying to remove the "docker.io" domain from locations where it's not relevant.
In these cases, this domain was used as a "random" domain for testing or example
purposes.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 15:27:58 +01:00
Sebastiaan van Stijn
d73aba2500
Merge pull request #42264 from thaJeztah/update_the_update
restartmanager:  Remove RestartManager interface, and unused error return
2023-01-10 11:40:36 +01:00
Sebastiaan van Stijn
9a8b8009f4
Merge pull request #44772 from crazy-max/update-buildkit-ref
ci: update buildkit to fix integration tests
2023-01-10 11:31:20 +01:00
CrazyMax
dc30785947
ci: update buildkit to fix integration tests
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-10 09:43:06 +01:00
Bjorn Neergaard
62227e1bba
Merge pull request #44733 from jg-public/fix-rootless-specspaths--T43111
Use user data path for plugin discovery in rootless mode
2023-01-09 17:32:11 -07:00
Bjorn Neergaard
1ef0a1b1be
Merge pull request #44762 from AkihiroSuda/fix-btrfs-kernel-requirement
graphdriver/btrfs: needs kernel headers >= 4.12, not >= 4.7
2023-01-09 16:56:32 -07:00
Bjorn Neergaard
5db247da9d
Merge pull request #44770 from neersighted/ignore_bom
daemon/config: ignore UTF-8 BOM in config JSON
2023-01-09 16:41:57 -07:00
Samuel Karp
214cd9d1e6
Merge pull request #44768 from thaJeztah/vendor_containerd_1.6.15 2023-01-09 13:23:54 -08:00
Tianon Gravi
a558074474
Merge pull request #43248 from thaJeztah/cleanup_translateContainerdStartErr
daemon: refactor translateContainerdStartErr() and remove unused argument
2023-01-09 13:23:19 -08:00
Bjorn Neergaard
cba3edbc37
daemon/config: group JSON preprocessing steps
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-09 13:17:32 -07:00
Bjorn Neergaard
bb19265ba8
daemon/config: ignore UTF-8 BOM in config JSON
[RFC 8259] allows for JSON implementations to optionally ignore a BOM
when it helps with interoperability; do so in Moby as Notepad (the only
text editor available out of the box in many versions of Windows Server)
insists on writing UTF-8 with a BOM.

  [RFC 8259]: https://tools.ietf.org/html/rfc8259#section-8.1

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-09 13:16:57 -07:00
Albin Kerouanton
2d397beb00
libnetwork: Support IPv6 in arrangeUserFilterRule()
Fixes #44451.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2023-01-09 17:18:28 +01:00
Jan Garcia
6ab12ec8f4 rootless: move ./rootless to ./pkg/rootless
Signed-off-by: Jan Garcia <github-public@n-garcia.com>
2023-01-09 16:26:06 +01:00
Jan Garcia
c1bd5e9144 Use user paths for plugin discovery in rootless mode
Signed-off-by: Jan Garcia <github-public@n-garcia.com>
2023-01-09 16:26:06 +01:00
Sebastiaan van Stijn
bffe6d5670
vendor: github.com/containerd/containerd v1.6.15
no changes to vendored files

full diff: https://github.com/containerd/containerd/compare/v1.6.14...v1.6.15

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-09 13:26:32 +01:00
Sebastiaan van Stijn
eaa7b49bd6
Merge pull request #44749 from vvoland/fix-test-race-logs-goroutines
integration-cli: Fix hangs in TestLogsFollowGoroutines*
2023-01-09 13:00:14 +01:00
Akihiro Suda
89fb8b32f6
graphdriver/btrfs: needs kernel headers >= 4.12, not >= 4.7
`linux/btrfs_tree.h` was not installed to `/usr/include` until kernel 4.12
fcc8487d47

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-01-08 05:04:47 +09:00
Josh Chorlton
c12d7b6d21 upgrade to aws sdk go v2
Co-Authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Josh Chorlton <jchorlton@gmail.com>
Signed-off-by: Cory Snider <csnider@mirantis.com>
Signed-off-by: Josh Chorlton <jchorlton@gmail.com>
2023-01-07 17:27:31 +00:00
Bjorn Neergaard
6834304feb
Merge pull request #44761 from neersighted/btrfs_uapi
graphdriver/btrfs: depend on kernel UAPI instead of libbtrfs
2023-01-06 15:20:20 -07:00
Bjorn Neergaard
aa80c33360
Dockerfile.*: drop libbtrfs
This is no longer necessary after the switch to the kernel UAPI.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-06 13:23:09 -07:00
Bjorn Neergaard
c9d632e485
PACKAGERS: update Btrfs graphdriver dependencies
We only need suitable UAPI headers now. They are available on kernel 4.7
and newer; out of the distributions currently in support that users
might be interested in, only Enterprise Linux 7 has too old a kernel
(3.10).

Users of Enterprise Linux 7 distros can compile using a newer platform,
disable the Btrfs graphdriver as documented in this file, or use newer
kernel headers on their older distro.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-06 13:23:06 -07:00
Bjorn Neergaard
d3778d65fa
graphdriver/btrfs: use free wrapper consistently
While the Cgo in this entire file is quite questionable, that is a task
for another day.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-06 13:23:05 -07:00
Bjorn Neergaard
3208dcabdc
graphdriver/btrfs: use kernel UAPI headers
By relying on the kernel UAPI (userspace API), we can drop a dependency
and simplify building Moby, while also ensuring that we are using a
stable/supported source of the C types and defines we need.

btrfs-progs mirrors the kernel headers, but the headers it ships with
are not the canonical source and as [we have seen before][44698], could
be subject to changes.

Depending on the canonical headers from the kernel both is more
idiomatic, and ensures we are protected by the kernel's promise to not
break userspace.

  [44698]: https://github.com/moby/moby/issues/44698

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-06 13:22:58 -07:00
Bjorn Neergaard
1449c82484
graphdriver/btrfs: drop version information
This is actually quite meaningless as we are reporting the libbtrfs
version, but we do not use libbtrfs. We only use the kernel interface to
btrfs instead.

While we could report the version of the kernel headers in play, they're
rather all-or-nothing: they provide the structures and defines we need,
or they don't. As such, drop all version information as the host kernel
version is the only thing that matters.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-06 11:13:23 -07:00
Sebastiaan van Stijn
937491288e
Merge pull request #43818 from thaJeztah/image_inspect
add support for image inspect with containerd-integration
2023-01-06 17:40:15 +01:00
Brian Goff
73e09ddecf
Merge pull request #43787 from thaJeztah/memdb_nits
container: ViewDB: cleanup error-types
2023-01-06 08:09:06 -08:00
Sebastiaan van Stijn
8fb13036ee
Merge pull request #44754 from tianon/requireRegistryMatch
Remove reference to "requireRegistryMatch"
2023-01-05 22:10:15 +01:00
Tianon Gravi
fdcab58ccf Remove reference to "requireRegistryMatch"
This option appears to never have actually existed in the merged implementation. 😄

Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
2023-01-05 11:28:22 -08:00
Sebastiaan van Stijn
57af88a654
Merge pull request #44748 from vvoland/buildflags-nopie-whenrace
hack/make: Don't add -buildmode=pie with -race
2023-01-05 20:24:21 +01:00
Bjorn Neergaard
9353fc6a27
Merge pull request #44744 from KirkEasterson/kirk/fix-broken-contributing-link
Updated outdated docker contributing guidelines link
2023-01-05 10:48:10 -07:00
Bjorn Neergaard
9409b5623d
Merge pull request #44746 from crazy-max/fix-binary-daemon
hack: restore copy_binaries func
2023-01-05 10:45:53 -07:00
Paweł Gronowski
deb4910c5b
integration-cli: Fix hanging TestLogsFollowGoroutines*
cmd.Wait is called twice from different goroutines which can cause the
test to hang completely. Fix by calling Wait only once and sending its
return value over a channel.

In TestLogsFollowGoroutinesWithStdout also added additional closes and
process kills to ensure that we don't leak anything in case test returns
early because of failed test assertion.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-05 18:10:32 +01:00
Bjorn Neergaard
e9275392c1
Merge pull request #44742 from akerouanton/fix-44688
Clear conntrack entries for published UDP ports
2023-01-05 10:04:29 -07:00
Nicolas De Loof
1616a09b61 add support for image inspect with containerd-integration
This is a squashed version of various PRs (or related code-changes)
to implement image inspect with the containerd-integration;

- add support for image inspect
- introduce GetImageOpts to manage image inspect data in backend
- GetImage to return image tags with details
- list images matching digest to discover all tags
- Add ExposedPorts and Volumes to the image returned
- Refactor resolving/getting images
- Return the image ID on inspect
- consider digest and ignore tag when both are set
- docker run --platform

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-05 16:20:41 +01:00
Paweł Gronowski
bbe6e9e8d1
hack/make: Don't add -buildmode=pie with -race
Make it possible to add `-race` to the BUILDFLAGS without making the
build fail with error:
"-buildmode=pie not supported when -race is enabled"

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-05 15:28:03 +01:00
CrazyMax
7e7b0622a6
hack: restore copy_binaries func
This function is still useful for the dev environment.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-05 13:21:28 +01:00
Albin Kerouanton
b37d34307d
Clear conntrack entries for published UDP ports
Conntrack entries are created for UDP flows even if there's nowhere to
route these packets (ie. no listening socket and no NAT rules to
apply). Moreover, iptables NAT rules are evaluated by netfilter only
when creating a new conntrack entry.

When Docker adds NAT rules, netfilter will ignore them for any packet
matching a pre-existing conntrack entry. In such case, when
dockerd runs with userland proxy enabled, packets got routed to it and
the main symptom will be bad source IP address (as shown by #44688).

If the publishing container is run through Docker Swarm or in
"standalone" Docker but with no userland proxy, affected packets will
be dropped (eg. routed to nowhere).

As such, Docker needs to flush all conntrack entries for published UDP
ports to make sure NAT rules are correctly applied to all packets.

- Fixes #44688
- Fixes #8795
- Fixes #16720
- Fixes #7540
- Fixes moby/libnetwork#2423
- and probably more.

As a precautionary measure, those conntrack entries are also flushed
when revoking external connectivity to avoid those entries to be reused
when a new sandbox is created (although the kernel should already
prevent such case).

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2023-01-05 12:53:22 +01:00
Kirk Easterson
1fdfd45995 Updated outdated docker contributing guidelines link
Signed-off-by: Kirk Easterson <kirk.easterson@gmail.com>
2023-01-04 09:36:59 +01:00