Commit graph

46095 commits

Author SHA1 Message Date
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
Sebastiaan van Stijn
1261fe69a3
API: deprecate VirtualSize field for /images/json and /images/{id}/json
In versions of Docker before v1.10, this field was calculated from
the image itself and all of its parent images. Images are now stored
self-contained, and no longer use a parent-chain, making this field
an equivalent of the Size field.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-18 14:46:11 +02:00
Sebastiaan van Stijn
20a1d23b39
Merge pull request #45320 from akerouanton/info-no-new-privileges
Add no-new-privileges to SecurityOptions returned by /info
2023-04-18 14:37:15 +02:00
Albin Kerouanton
eb7738221c
Add no-new-privileges to SecurityOptions returned by /info
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2023-04-18 09:34:08 +02:00
Sebastiaan van Stijn
7103efac9d
Merge pull request #45347 from thaJeztah/align_size_virtualsize
c8d: align "Size" and "VirtualSize" for images
2023-04-17 23:45:35 +02:00
Sebastiaan van Stijn
e7980275c0
c8d: align "Size" and "VirtualSize" for images
In versions of Docker before v1.10, this field was calculated from
the image itself and all of its parent images. Images are now stored
self-contained, and no longer use a parent-chain, making this field
an equivalent of the Size field.

For the containerd integration, the Size should be the sum of the
image's compressed / packaged and unpacked (snapshots) layers.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-17 22:39:00 +02:00
Albin Kerouanton
1e1efe1f61
libnet/d/overlay: clean up iptables rules on network delete
This commit removes iptables rules configured for secure overlay
networks when a network is deleted. Prior to this commit, only
CreateNetwork() was taking care of removing stale iptables rules.

If one of the iptables rule can't be removed, the erorr is logged but
it doesn't prevent network deletion.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2023-04-17 17:21:21 +02:00
Sebastiaan van Stijn
ad2ab4927c
Merge pull request #45345 from thaJeztah/no_version_loop
api/server: getImagesJSON(): don't check version in a loop
2023-04-17 14:37:36 +02:00
Sebastiaan van Stijn
9a9dfb1d0d
api/server: getImagesJSON(): don't check version in a loop
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-17 13:07:49 +02:00
Sebastiaan van Stijn
3903f16cd6
daemon: remove deprecated AuFS storage driver
There's still some locations refering to AuFS;

- pkg/archive: I suspect most of that code is because the whiteout-files
  are modelled after aufs (but possibly some code is only relevant to
  images created with AuFS as storage driver; to be looked into).
- contrib/apparmor/template: likely some rules can be removed
- contrib/dockerize-disk.sh: very old contribution, and unlikely used
  by anyone, but perhaps could be updated if we want to (or just removed).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-15 01:27:16 +02:00
Sebastiaan van Stijn
5bf405b2af
Merge pull request #45227 from PettitWesley/fix-awslogs-non-blocking
awslogs: fix non-blocking log drop bug
2023-04-15 00:56:57 +02:00
Sebastiaan van Stijn
5b1282c708
Merge pull request #45329 from thaJeztah/vendor_runc_1.1.6
vendor: github.com/opencontainers/runc v1.1.6
2023-04-14 11:58:52 +02:00
Akihiro Suda
d81e0f5789
Merge pull request #45335 from thaJeztah/fix_buildkit_version
builder-next: fix buildkit version
2023-04-14 18:55:14 +09:00
Sebastiaan van Stijn
2fbbd04979
Merge pull request #45334 from rumpl/c8d-fix-snapshot-prepare
c8d: Fix returning errors from snapshotter.Prepare
2023-04-14 11:09:22 +02:00
Sebastiaan van Stijn
890959eea8
builder-next: fix buildkit version
Update the version manually (we don't have automation for this yet), and
add a comment to vendor.mod to help users remind to update it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-14 10:44:27 +02:00
Djordje Lukic
bc37e3f830
Fix returning errors from snapshotter.Prepare
In the case of an error when calling snapshotter.Prepare we would return
nil. This change fixes that and returns the error from Prepare all the
time.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2023-04-14 10:10:52 +02:00
Sebastiaan van Stijn
d69f9fe266
Merge pull request #45270 from vvoland/c8d-prune-upstream
c8d: Implement prune
2023-04-14 02:29:38 +02:00
Sebastiaan van Stijn
cca3af03ac
Merge pull request #45325 from kpcyrd/rootless-script-bugs
Fix argv quoting bugs in dockerd-rootless.sh
2023-04-14 01:25:41 +02:00
Sebastiaan van Stijn
61656464d8
Merge pull request #45315 from thaJeztah/deprecate_oom_score_adjust
daemon: deprecate --oom-score-adjust for the daemon
2023-04-14 00:06:58 +02:00
Paweł Gronowski
f846349824
c8d/list: Implement until filter
It's not originally supported by image list, but we need it for `prune`
needs it, so `list` gets it for free.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-13 20:30:29 +02:00
Paweł Gronowski
d89590eab9
c8d: Implement prune
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-13 20:30:27 +02:00
Sebastiaan van Stijn
e6ac640d2e
vendor: github.com/opencontainers/runc v1.1.6
release notes: https://github.com/opencontainers/runc/releases/tag/v1.1.6
full diff: https://github.com/opencontainers/runc/compare/v1.1.5...v1.1.6

This is the sixth patch release in the 1.1.z series of runc, which fixes
a series of cgroup-related issues.

Note that this release can no longer be built from sources using Go
1.16. Using a latest maintained Go 1.20.x or Go 1.19.x release is
recommended. Go 1.17 can still be used.

- systemd cgroup v1 and v2 drivers were deliberately ignoring UnitExist error
  from systemd while trying to create a systemd unit, which in some scenarios
  may result in a container not being added to the proper systemd unit and
  cgroup.
- systemd cgroup v2 driver was incorrectly translating cpuset range from spec's
  resources.cpu.cpus to systemd unit property (AllowedCPUs) in case of more
  than 8 CPUs, resulting in the wrong AllowedCPUs setting.
- systemd cgroup v1 driver was prefixing container's cgroup path with the path
  of PID 1 cgroup, resulting in inability to place PID 1 in a non-root cgroup.
- runc run/start may return "permission denied" error when starting a rootless
  container when the file to be executed does not have executable bit set for
  the user, not taking the CAP_DAC_OVERRIDE capability into account. This is
  a regression in runc 1.1.4, as well as in Go 1.20 and 1.20.1
- cgroup v1 drivers are now aware of misc controller.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-13 19:55:23 +02:00
Sebastiaan van Stijn
f531e3cf69
vendor: golang.org/x/net v0.8.0
full diff: https://github.com/golang/net/compare/v0.7.0...v0.8.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-13 19:54:33 +02:00
Sebastiaan van Stijn
3886faced8
vendor: golang.org/x/text v0.8.0
full diff: https://github.com/golang/text/compare/v0.7.0...v0.8.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-13 19:53:50 +02:00
Sebastiaan van Stijn
d0efca893b
update runc binary to v1.1.6
release notes: https://github.com/opencontainers/runc/releases/tag/v1.1.6
full diff: https://github.com/opencontainers/runc/compare/v1.1.5...v1.1.6

This is the sixth patch release in the 1.1.z series of runc, which fixes
a series of cgroup-related issues.

Note that this release can no longer be built from sources using Go
1.16. Using a latest maintained Go 1.20.x or Go 1.19.x release is
recommended. Go 1.17 can still be used.

- systemd cgroup v1 and v2 drivers were deliberately ignoring UnitExist error
  from systemd while trying to create a systemd unit, which in some scenarios
  may result in a container not being added to the proper systemd unit and
  cgroup.
- systemd cgroup v2 driver was incorrectly translating cpuset range from spec's
  resources.cpu.cpus to systemd unit property (AllowedCPUs) in case of more
  than 8 CPUs, resulting in the wrong AllowedCPUs setting.
- systemd cgroup v1 driver was prefixing container's cgroup path with the path
  of PID 1 cgroup, resulting in inability to place PID 1 in a non-root cgroup.
- runc run/start may return "permission denied" error when starting a rootless
  container when the file to be executed does not have executable bit set for
  the user, not taking the CAP_DAC_OVERRIDE capability into account. This is
  a regression in runc 1.1.4, as well as in Go 1.20 and 1.20.1
- cgroup v1 drivers are now aware of misc controller.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-13 19:43:05 +02:00