Commit graph

45918 commits

Author SHA1 Message Date
Sebastiaan van Stijn
85f1a2809f
Merge pull request #45218 from thaJeztah/new_curators
Add Laura and Albin as curator
2023-03-28 17:26:43 +02:00
Sebastiaan van Stijn
4f511bd06e
Add akerouanton as curator
Adding Albin as curator so that he can help triage.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-28 11:01:28 +02:00
Sebastiaan van Stijn
bb2c5617d6
Add laurazard as curator
Adding Laura as curator so that she can help with triage.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-28 11:01:10 +02:00
Sebastiaan van Stijn
cba6f2d426
Merge pull request #45203 from cpuguy83/client_add_buildkit_helper
client: Add buildkit ClientOpts
2023-03-27 20:51:53 +02:00
Sebastiaan van Stijn
54130b542d
Merge pull request #45214 from thaJeztah/bump_buildkit
vendor: github.com/moby/buildkit v0.11.5
2023-03-27 19:57:35 +02:00
Brian Goff
0a334ea081
Merge pull request #45164 from corhere/libnet/peer-op-function-call
libnetwork/d/overlay: handle peer ops directly
2023-03-27 09:46:49 -07:00
Sebastiaan van Stijn
17d94cf3b9
Merge pull request #45212 from akerouanton/update-delve
Update delve version
2023-03-25 15:15:43 +01:00
Sebastiaan van Stijn
6f4ccb6832
Merge pull request #45211 from akerouanton/fix-windows-log
libnet/d/windows: log EnableInternalDNS val after setting it
2023-03-25 14:39:22 +01:00
Sebastiaan van Stijn
988d26afe4
vendor: github.com/moby/buildkit v0.11.5
full diff: https://github.com/moby/buildkit/compare/v0.11.4...v0.11.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-25 14:37:07 +01:00
Samuel Karp
270d4ec23d
Merge pull request #45195 from thaJeztah/useragent_once 2023-03-24 16:28:08 -07:00
Tianon Gravi
6caaa8cadc Prefer loading docker-init from an appropriate "libexec" directory
The `docker-init` binary is not intended to be a user-facing command, and as such it is more appropriate for it to be found in `/usr/libexec` (or similar) than in `PATH` (see the FHS, especially https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html and https://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html#USRLIBLIBRARIESFORPROGRAMMINGANDPA).

This adjusts the logic for using that configuration option to take this into account and appropriately search for `docker-init` (or the user's configured alternative) in these directories before falling back to the existing `PATH` lookup behavior.

This behavior _used_ to exist for the old `dockerinit` binary (of a similar name and used in a similar way but for an alternative purpose), but that behavior was removed in 4357ed4a73 when that older `dockerinit` was also removed.

Most of this reasoning _also_ applies to `docker-proxy` (and various `containerd-xxx` binaries such as the shims), but this change does not affect those.  It would be relatively straightforward to adapt `LookupInitPath` to be a more generic function such as `libexecLookupPath` or similar if we wanted to explore that.

See 14482589df/cli-plugins/manager/manager_unix.go for the related path list in the CLI which loads CLI plugins from a similar set of paths (with a similar rationale - plugin binaries are not typically intended to be run directly by users but rather invoked _via_ the CLI binary).

Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
2023-03-24 14:25:12 -07:00
Albin Kerouanton
bae49ff278
libnet/d/windows: log EnableInternalDNS val after setting it
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2023-03-24 18:23:21 +01:00
Albin Kerouanton
4f48a4ea2a
Update delve version
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2023-03-24 17:44:14 +01:00
Brian Goff
0fa7a4e3b4 client: Add buildkit ClientOpts
This adds a function to the client package which can be used to create a
buildkit client from our moby client.

Example:

```go
package main

import (
  "context"

  "github.com/moby/moby/client"
  bkclient "github.com/moby/buildkit/client"
)

func main() {
  c := client.NewWithOpts()
  bc, _ := bkclient.New(context.Background(), ""
    client.BuildkitClientOpts(c),
  )
  // ...
}
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-03-23 21:51:56 +00:00
Bjorn Neergaard
d7e6e33d07
Merge pull request #45191 from thaJeztah/bump_swarmkit
vendor: github.com/moby/swarmkit/v2 v2.0.0-20230315203717-e28e8ba9bc83
2023-03-23 12:16:48 -06:00
Cory Snider
965eda3b9a libnet/d/overlay: insert the input-drop rule
FirewallD creates the root INPUT chain with a default-accept policy and
a terminal rule which rejects all packets not accepted by any prior
rule. Any subsequent rules appended to the chain are therefore inert.
The administrator would have to open the VXLAN UDP port to make overlay
networks work at all, which would result in all VXLAN traffic being
accepted and defeating our attempts to enforce encryption on encrypted
overlay networks.

Insert the rule to drop unencrypted VXLAN packets tagged for encrypted
overlay networks at the top of the INPUT chain so that enforcement of
mandatory encryption takes precedence over any accept rules configured
by the administrator. Continue to append the accept rule to the bottom
of the chain so as not to override any administrator-configured drop
rules.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-03-22 20:54:01 -04:00
Sebastiaan van Stijn
66dfc0169f
dockerversion: DockerUserAgent(): use sync.Once to construct User-Agent
The User-Agent includes the kernel version, which involves making a syscall
(and parsing the results) on Linux, and reading (plus parsing) the registry
on Windows. These operations are relatively costly, and we should not perform
those on every request that uses the User-Agent.

This patch adds a sync.Once so that we only perform these actions once for
the lifetime of the daemon's process.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-22 15:35:59 +01:00
Sebastiaan van Stijn
1855a55d8c
Merge pull request #45185 from thaJeztah/pass_useragent_as_header
registry/search: pass User-Agent through headers
2023-03-22 12:41:56 +01:00
Sebastiaan van Stijn
72dc7a0f7b
vendor: github.com/moby/swarmkit/v2 v2.0.0-20230315203717-e28e8ba9bc83
- CSI: Manager PublishVolume verify CSI node ID is not empty

full diff: a745a8755c...e28e8ba9bc

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-22 11:56:28 +01:00
Brian Goff
b19dbee3f7
Merge pull request #45168 from vvoland/integration-restart-race
TestDaemonRestartKillContainers: Fix races
2023-03-21 23:38:20 +00:00
Brian Goff
c7ccc68b15 Silence GRPC logs unless our log level is debug
GRPC is logging a *lot* of garbage at info level.
This configures the GRPC logger such that it is only giving us logs when
at debug level and also adds a log field indicating where the logs are
coming from.

containerd is still currently spewing these same log messages and needs
a separate update.

Without this change `docker build` is extremely noisy in the daemon
logs.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-03-21 21:01:10 +00:00
Paweł Gronowski
be34e93f20
integration-cli: Enable TestExecStartFails on Windows
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-21 17:23:40 +01:00
Sebastiaan van Stijn
cb76638699
registry/search: pass User-Agent through headers
Commit 3991faf464 moved search into the registry
package, which also made the `dockerversion` package a dependency for registry,
which brings additional (indirect) dependencies, such as `pkg/parsers/kernel`,
and `golang.org/x/sys/windows/registry`.

Client code, such as used in docker/cli may depend on the `registry` package,
but should not depend on those additional dependencies.

This patch moves setting the userAgent to the API router, and instead of
passing it as a separate argument, includes it into the "headers".

As these headers now not only contain the `X-Meta-...` headers, the variables
were renamed accordingly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-21 14:41:29 +01:00
Paweł Gronowski
88992de283
StartWithLogFile: Fix d.cmd race
Use `exec.Command` created by this function instead of obtaining it from
daemon struct. This prevents a race condition where `daemon.Kill` is
called before the goroutine has the chance to call `cmd.Wait`.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-20 16:16:44 +01:00
Paweł Gronowski
fed1c96e10
TestDaemonRestartKillContainers: Fix loop capture
TestDaemonRestartKillContainers test was always executing the last case
(`container created should not be restarted`) because the iterated
variables were not copied correctly.
Capture iterated values by value correctly and rename c to tc.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-20 16:16:42 +01:00
Brian Goff
7489b51f61
Merge pull request #45167 from thaJeztah/hostconfig_follow_ups
api/types/container: fix handling of "container" mode, increase test-coverage
2023-03-19 15:04:55 +00:00
Bjorn Neergaard
2cf6389142
Merge pull request #45153 from neersighted/carry_45112
builder-next: disable mergeop and diffop
2023-03-16 12:12:32 -06:00
Bjorn Neergaard
f5050d4ef2
ci: disable testing mergeop and diffop with the dockerd worker
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-03-16 08:29:39 -06:00
Tonis Tiigi
0ac3bf837b
builder-next: disable mergeop and diffop
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-03-16 08:23:22 -06:00
Sebastiaan van Stijn
8c87641258
Merge pull request #44908 from crazy-max/c8d-buildkit-tests
ci: enable BuildKit tests with containerd integration worker
2023-03-16 13:16:58 +01:00
CrazyMax
c14463d1e4
ci: enable BuildKit tests with containerd integration worker
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-03-16 12:07:06 +01:00
Sebastiaan van Stijn
90e82a2c05
Merge pull request #45158 from thaJeztah/containerd_1.7_deps
vendor: assorted vendor updates for containerd 1.7.0
2023-03-16 01:18:39 +01:00
Cory Snider
105b9834fb libnet/d/overlay: add BPF-powered VNI matcher
Some newer distros such as RHEL 9 have stopped making the xt_u32 kernel
module available with the kernels they ship. They do ship the xt_bpf
kernel module, which can do everything xt_u32 can and more. Add an
alternative implementation of the iptables match rule which uses xt_bpf
to implement exactly the same logic as the u32 filter using a BPF
program. Try programming the BPF-powered rules as a fallback when
programming the u32-powered rules fails.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-03-15 19:33:51 -04:00
Cory Snider
44cf27b5fc libnet/d/overlay: extract VNI match rule builder
The iptables rule clause used to match on the VNI of VXLAN datagrams
looks like line noise to the uninitiated. It doesn't help that the
expression is repeated twice and neither copy has any commentary.
DRY out the rule builder to a common function, and document what the
rule does and how it works.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-03-15 19:30:28 -04:00
Cory Snider
142f46cac1 libn/d/overlay: enforce encryption on sandbox init
The iptables rules which make encryption mandatory on an encrypted
overlay network are only programmed once there is a second node
participating in the network. This leaves single-node encrypted overlay
networks vulnerable to packet injection. Furthermore, failure to program
the rules is not treated as a fatal error.

Program the iptables rules to make encryption mandatory before creating
the VXLAN link to guarantee that there is no window of time where
incoming cleartext VXLAN packets for the network would be accepted, or
outgoing cleartext packets be transmitted. Only create the VXLAN link if
programming the rules succeeds to ensure that it fails closed.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-03-15 19:28:11 -04:00
Sebastiaan van Stijn
0ac02ba342
vendor: github.com/opencontainers/runtime-spec v1.1.0-rc.1
full diff: https://github.com/opencontainers/runtime-spec/compare/1c3f411f0417...v1.1.0-rc.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-16 00:06:50 +01:00
Sebastiaan van Stijn
ab131642a1
vendor: github.com/opencontainers/runc v1.1.4
no changes in vendored files

full diff: https://github.com/opencontainers/runc/compare/v1.1.3...v1.1.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-16 00:06:50 +01:00
Sebastiaan van Stijn
b98c05dc50
vendor: github.com/klauspost/compress v1.16.3
full diff: https://github.com/klauspost/compress/compare/v1.15.12...v1.16.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-16 00:06:12 +01:00
Sebastiaan van Stijn
664c0d3201
vendor: github.com/godbus/dbus/v5 v5.1.0
full diff: https://github.com/godbus/dbus/compare/v5.0.6...v5.1.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-16 00:05:55 +01:00
Sebastiaan van Stijn
3e4ce10342
vendor: github.com/coreos/go-systemd/v22 v22.5.0
full diff: https://github.com/coreos/go-systemd/compare/v22.4.0...v22.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-16 00:05:55 +01:00
Sebastiaan van Stijn
0a2e3f14e7
vendor: github.com/opencontainers/selinux v1.11.0
full diff: https://github.com/opencontainers/selinux/compare/v1.10.2...v1.11.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-16 00:05:55 +01:00
Sebastiaan van Stijn
bc1dec71c5
vendor: github.com/imdario/mergo v0.3.13
full diff: https://github.com/imdario/mergo/compare/v0.3.12...v0.3.13

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-16 00:05:55 +01:00
Sebastiaan van Stijn
9752e43644
vendor: golang.org/x/sys v0.6.0
full diff: https://github.com/golang/sys/compare/v0.5.0...v0.6.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-16 00:05:52 +01:00
Cory Snider
d4fd582fb2 libnet/d/overlay: document some encryption code
The overlay-network encryption code is woefully under-documented, which
is especially problematic as it operates on under-documented kernel
interfaces. Document what I have puzzled out of the implementation for
the benefit of the next poor soul to touch this code.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-03-15 17:26:24 -04:00
Sebastiaan van Stijn
58504620c5
api/types/container: IpcMode: use common function for container-mode
Use the utility introduced in 1bd486666b to
share the same implementation as similar options. The IPCModeContainer const
is left for now, but we need to consider what to do with these.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-15 18:49:15 +01:00
Sebastiaan van Stijn
6f0e28d024
api/types/container: PidMode: fix validation for empty container name/ID
Commit e7d75c8db7 fixed validation of "host"
mode values, but also introduced a regression for validating "container:"
mode PID-modes.

PID-mode implemented a stricter validation than the other options and, unlike
the other options, did not accept an empty container name/ID. This feature was
originally implemented in fb43ef649b, added some
some integration tests (but no coverage for this case), and the related changes
in the API types did not have unit-tests.

While a later change (d4aec5f0a6) added a test
for the `--pid=container:` (empty name) case, that test was later migrated to
the CLI repository, as it covered parsing the flag (and validating the result).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-15 18:49:15 +01:00
Sebastiaan van Stijn
53c813961e
api/types/container: fix .Container() returning a name, when it shouldn't
commit 1bd486666b refactored this code, but
it looks like I removed some changes in this part of the code when extracting
these changes from a branch I was working on, and the behavior did not match
the function's description (name to be empty if there is no "container:" prefix
Unfortunately, there was no test coverage for this in this repository, so we
didn't catch this.

This patch:

- fixes containerID() to not return a name/ID if no container: prefix is present
- adds test-coverage for TestCgroupSpec
- adds test-coverage for NetworkMode.ConnectedContainer
- updates some test-tables to remove duplicates, defaults, and use similar cases

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-15 18:49:15 +01:00
Sebastiaan van Stijn
c76331e13f
api/types/container: put "valid" field as first check in tests
Make if more explicit which test-cases should be valid, and make it the
first field, because the "valid" field is shared among all test-cases in
the test-table, and making it the first field makes it slightly easier
to distinguish valid from invalid cases.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-15 18:49:14 +01:00
Sebastiaan van Stijn
e828895f20
Merge pull request #44949 from thaJeztah/remove_system_meminfo_alias
pkg/sysinfo: move MemInfo and ReadMemInfo to a separate package
2023-03-15 18:49:03 +01:00
Sebastiaan van Stijn
2d49080056
pkg/sysinfo: move MemInfo and ReadMemInfo to a separate package
Commit 6a516acb2e moved the MemInfo type and
ReadMemInfo() function into the pkg/sysinfo package. In an attempt to assist
consumers of these to migrate to the new location, an alias was added.

Unfortunately, the side effect of this alias is that pkg/system now depends
on pkg/sysinfo, which means that consumers of this (such as docker/cli) now
get all (indirect) dependencies of that package as dependency, which includes
many dependencies that should only be needed for the daemon / runtime;

- github.com/cilium/ebpf
- github.com/containerd/cgroups
- github.com/coreos/go-systemd/v22
- github.com/godbus/dbus/v5
- github.com/moby/sys/mountinfo
- github.com/opencontainers/runtime-spec

This patch moves the MemInfo related code to its own package. As the previous move
was not yet part of a release, we're not adding new aliases in pkg/sysinfo.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-15 17:52:45 +01:00