Commit graph

46119 commits

Author SHA1 Message Date
Paweł Gronowski
520aa08d42
c8d/prune: Logging fixes
- Use logrus.Fields instead of multiple WithField
- Split one giant debug log into one log per image

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-26 16:40:37 +02:00
Paweł Gronowski
52af6d957e
c8d/prune: Remove gc.ref labels from configs of deleted images
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-26 16:40:34 +02:00
Cory Snider
993ca8c6de cmd/dockerd/trap: log to logrus directly
Logging through a dependency-injected interface value was a vestige of
when Trap was in pkg/signal to avoid importing logrus in a reusable
package: cc4da81128.
Now that Trap lives under cmd/dockerd, nobody will be importing this so
we no longer need to worry about minimizing the package's dependencies.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-04-26 09:53:01 -04:00
Cory Snider
0f3c5d3893 cmd/dockerd/trap: don't force exit after cleanup
Always calling os.Exit() on clean shutdown may not always be desirable
as deferred functions are not run. Let the cleanup callback decide
whether or not to call os.Exit() itself. Allow the process to exit the
normal way, by returning from func main().

Simplify the trap.Trap implementation. The signal notifications are
buffered in a channel so there is little need to spawn a new goroutine
for each received signal. With all signals being handled in the same
goroutine, there are no longer any concurrency concerns around the
interrupt counter.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-04-26 09:51:36 -04:00
Djordje Lukic
a1e1038736
Use the image service instead of the reference store for tagging
The image store sends events when a new image is created/tagged, using
it instead of the reference store makes sure we send the "tag" event
when a new image is built using buildx.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2023-04-26 15:10:01 +02:00
Paweł Gronowski
9fe5ac6614
c8d: Handle nil container.ImageManifest
Don't panic when processing containers created under fork containerd
integration (this field was added in the upstream and didn't exist in
fork).

Co-authored-by: Djordje Lukic <djordje.lukic@docker.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-26 14:54:01 +02:00
Sebastiaan van Stijn
214e200f95
Merge pull request #45308 from corhere/libnet/overlay-bpf-ipv6
libnetwork/drivers/overlay: make VNI matcher IPv6-compatible
2023-04-26 14:37:09 +02:00
Sebastiaan van Stijn
2379b49177
Merge pull request #45362 from laurazard/c8d-delete-short-images
c8d: add support for removing images by shortID
2023-04-26 11:34:34 +02:00
Cory Snider
16d5d4b6e1 cmd/dockerd: ignore SIGPIPE using signal.Ignore
The fix to ignore SIGPIPE signals was originally added in the Go 1.4
era. signal.Ignore was first added in Go 1.5.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-04-25 17:50:12 -04:00
Brian Goff
0970cb054c
Merge pull request #45366 from akerouanton/fix-docker0-PreferredPool
daemon: set docker0 subpool as the IPAM pool
2023-04-25 11:07:57 -07:00
Sebastiaan van Stijn
801202349a
Merge pull request #45387 from cuishuang/master
fix some comments
2023-04-25 16:31:22 +02:00
Albin Kerouanton
2d31697d82
daemon: set docker0 subpool as the IPAM pool
Since cc19eba (backported to v23.0.4), the PreferredPool for docker0 is
set only when the user provides the bip config parameter or when the
default bridge already exist. That means, if a user provides the
fixed-cidr parameter on a fresh install or reboot their computer/server
without bip set, dockerd throw the following error when it starts:

> failed to start daemon: Error initializing network controller: Error
> creating default "bridge" network: failed to parse pool request for
> address space "LocalDefault" pool "" subpool "100.64.0.0/26": Invalid
> Address SubPool

See #45356.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2023-04-25 15:32:46 +02:00
Sebastiaan van Stijn
d8b784a15e
daemon/cluster: inline filters
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-25 15:17:44 +02:00
Sebastiaan van Stijn
da8e07edb5
volume/service: inline filters in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-25 15:17:25 +02:00
Sebastiaan van Stijn
c0c4a16053
testutil: inline filters in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-25 15:16:39 +02:00
Sebastiaan van Stijn
b6154189e8
integration: inline filters in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-25 15:15:50 +02:00
Sebastiaan van Stijn
1bc0d7080a
integration-cli: inline filters in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-25 15:14:27 +02:00
Sebastiaan van Stijn
5bc0832766
daemon: inline filters in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-25 15:13:26 +02:00
Sebastiaan van Stijn
081b5e3d4e
client: inline filters in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-25 15:11:32 +02:00
Kevin Alvarez
7665feeb52
hack: enable Go modules when building dockerd and docker-proxy
This is a workaround to have buildinfo with deps embedded in the
binary. We need to create a go.mod file before building with
-modfile=vendor.mod, otherwise it fails with:
"-modfile cannot be used to set the module root directory."

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-04-25 12:30:52 +02:00
CrazyMax
5400366b90
Set BuildKit version using buildinfo
This sets BuildKit version from the build information embedded
in running binary so we are aligned with the expected vendoring.

We iterate over all dependencies and find the BuildKit one
and set the right version. We also check if the module is
replaced and use it this case.

There is also additional checks if a pseudo version is
detected. See comments in code for more info.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-04-25 12:30:52 +02:00
Sebastiaan van Stijn
a343ed13e5
Merge pull request #45390 from vvoland/c8d-imagelist-fix-rootlen
c8d/list: Initialize capacity instead of length
2023-04-25 12:26:41 +02:00
Sebastiaan van Stijn
ed7b2a64f8
Merge pull request #45368 from thaJeztah/remove_overlay2.override_kernel_check
overlay2: remove deprecated overlay2.override_kernel_check option
2023-04-25 12:12:15 +02:00
Paweł Gronowski
aca8dde362
integration/TestKillContainer: Bigger timeout on Windows
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-25 11:59:54 +02:00
Sebastiaan van Stijn
599a258421
Merge pull request #45357 from tklauser/sched-getaffinity-pid-zero
pkg/sysinfo: omit Getpid call in numCPU
2023-04-25 11:21:30 +02:00
Sebastiaan van Stijn
fd03a52468
Merge pull request #45294 from vvoland/builder-fix-prune-timestamp
builder-next/prune: Handle `until` filter timestamps
2023-04-25 11:19:27 +02:00
Paweł Gronowski
391f9635cc
c8d/list: Initialize capacity instead of length
The slice which stores chain ids used for computing shared size was
mistakenly initialized with the length set instead of the capacity.
This caused a panic when iterating over it later and dereferncing nil
pointer from empty items.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-25 10:38:23 +02:00
Tobias Klauser
4ec063fade
pkg/sysinfo: omit Getpid call in numCPU
The man page for sched_setaffinity(2) states the following about the pid
argument [1]:

> If pid is zero, then the mask of the calling thread is returned.

Thus the additional call to unix.Getpid can be omitted and pid = 0
passed to unix.SchedGetaffinity.

[1] https://man7.org/linux/man-pages/man2/sched_setaffinity.2.html#DESCRIPTION

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2023-04-25 10:05:20 +02:00
cui fliter
f66684fdeb fix some comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-04-25 13:39:28 +08:00
Cory Snider
c399963243 libn/d/overlay: make VNI matcher IPv6-compatible
Use Linux BPF extensions to locate the offset of the VXLAN header within
the packet so that the same BPF program works with VXLAN packets
received over either IPv4 or IPv6.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-04-24 14:20:29 -04:00
Cory Snider
7d9bb170b7 libn/d/overlay: test the VNI BPF matcher on IPv4
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-04-24 14:19:39 -04:00
Akihiro Suda
9ff00e35f8
Merge pull request #45367 from tonistiigi/vendor-buildkit-v0.11.6
vendor: update buildkit to v0.11.6
2023-04-24 18:20:51 +09:00
吴小白
4876c09b2a build(deps): bump github.com/creack/pty from v1.1.11 to v1.1.18
Signed-off-by: 吴小白 <296015668@qq.com>
2023-04-24 11:11:40 +08:00
Laura Brehm
8df3db4b97
c8d: add support for removing images by shortID
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-04-21 10:30:53 +01:00
Paweł Gronowski
117ceac82b
daemon/prune: Use errdefs for invalid "until" value
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-21 10:25:57 +02:00
Paweł Gronowski
e502c69140
builder: use typed error for invalid "until" value
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-21 10:25:53 +02:00
Sebastiaan van Stijn
9791756284
overlay2: remove deprecated overlay2.override_kernel_check option
This option was deprecated in e35700eb50
(and backported to v23.0 through 43ce8f7d24).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-20 23:57:45 +02:00
Paweł Gronowski
54a125f677
builder-next/prune: Handle "until" filter timestamps
Fixes `docker system prune --filter until=<timestamp>`.
`docker system prune` claims to support "until" filter for timestamps,
but it doesn't work because builder "until" filter only supports
duration.
Use the same filter parsing logic and then convert the timestamp to a
relative "keep-duration" supported by buildkit.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-20 21:20:32 +02:00
Tianon Gravi
81359cecdf
Merge pull request #45328 from thaJeztah/runc_binary_1.1.6
update runc binary to v1.1.6
2023-04-20 11:30:54 -07:00
Bjorn Neergaard
660c04803e
Merge pull request #45310 from corhere/libn/delete-network-more-atomically
libnetwork: clean up inDelete network atomically
2023-04-20 20:26:24 +02:00
Tianon Gravi
f9ea1dac30
Merge pull request #45343 from akerouanton/overlay-cleanup-iptables-rules
libnet/overlay: clean up iptables rules on network delete
2023-04-20 11:23:47 -07:00
Tonis Tiigi
38e791fb2f
vendor: update buildkit to v0.11.6
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-04-20 11:17:25 -07:00
Brian Goff
d0df6c983c
Merge pull request #45359 from thaJeztah/remove_deprecated_overlay1
remove deprecated legacy "overlay" storage-driver
2023-04-20 11:08:52 -07:00
Sebastiaan van Stijn
5745ba6a8e
Merge pull request #45354 from thaJeztah/c8d_test_fixes
containerd integration: some test-fixes
2023-04-19 18:58:05 +02:00
Florian Schmaus
005150ed69 check-config.sh: do not check for RT_GROUP_SCHED
Unconditionally checking for RT_GROUP_SCHED is harmful. It is one of
the options that you want inactive unless you know that you want it
active.

Systemd recommends to disable it [1], a rationale for doing so is
provided in

    https://bugzilla.redhat.com/show_bug.cgi?id=1229700#c0.

The essence is that you can not simply enable RT_GROUP_SCHED, you also
have to assign budgets manually. If you do not assign budgets, then
your realtime scheduling will be affected.

If check-config.sh keeps recommending to enable this, without further
advice, then users will follow the recommendation and likely run into
issues.

Again, this is one of the options that you want inactive, unless you
know that you want to use it.

Related Gentoo bugs:
- https://bugs.gentoo.org/904264
- https://bugs.gentoo.org/606548

1: 39857544ee/README (L144-L150)

Signed-off-by: Florian Schmaus <flo@geekplace.eu>
2023-04-19 17:29:56 +02:00
Sebastiaan van Stijn
f72548956f
remove deprecated legacy "overlay" storage-driver
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-19 17:06:45 +02:00
Tianon Gravi
bbb94fd499
Merge pull request #45342 from thaJeztah/remove_deprecated_aufs_storage_driver
daemon: remove deprecated AuFS storage driver
2023-04-18 16:05:54 -07:00
Sebastiaan van Stijn
46c27e4552
Merge pull request #45346 from thaJeztah/deprecate_virtualsize
API: deprecate VirtualSize field for /images/json and /images/{id}/json
2023-04-18 15:39:58 +02:00
Sebastiaan van Stijn
4ecb587eff
daemon: skip TestGetInspectData when using containerd snapshotters
This test does not apply when running with snapshotters enabled;

    go test -v -run TestGetInspectData .
    === RUN   TestGetInspectData
        inspect_test.go:27: RWLayer of container inspect-me is unexpectedly nil
    --- FAIL: TestGetInspectData (0.00s)
    FAIL
    FAIL	github.com/docker/docker/daemon	0.049s
    FAIL

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-18 15:02:41 +02:00
Sebastiaan van Stijn
a82c434447
daemon: setupFakeDaemon(): add fakeImageService
To prevent a panic happening when running tests:

    === FAIL: daemon TestTmpfsDevShmNoDupMount (0.01s)
    panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x120 pc=0x261a373]

    goroutine 134 [running]:
    testing.tRunner.func1.2({0x28baf20, 0x3ea8000})
        /usr/local/go/src/testing/testing.go:1526 +0x24e
    testing.tRunner.func1()
        /usr/local/go/src/testing/testing.go:1529 +0x39f
    panic({0x28baf20, 0x3ea8000})
        /usr/local/go/src/runtime/panic.go:884 +0x213
    github.com/docker/docker/daemon.(*Daemon).createSpec(0xc0006e0000, {0x2ea5588, 0xc00012a008}, 0xc0003b5900)
        /go/src/github.com/docker/docker/daemon/oci_linux.go:1060 +0xf33
    github.com/docker/docker/daemon.TestTmpfsDevShmNoDupMount(0xc000b781a0?)
        /go/src/github.com/docker/docker/daemon/oci_linux_test.go:77 +0x20a
    testing.tRunner(0xc000b78340, 0x2c74210)
        /usr/local/go/src/testing/testing.go:1576 +0x10b
    created by testing.(*T).Run
        /usr/local/go/src/testing/testing.go:1629 +0x3ea

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-18 15:02:41 +02:00