Commit graph

45880 commits

Author SHA1 Message Date
Sebastiaan van Stijn
239e0a2d43
Merge pull request #44886 from AkihiroSuda/containerd-cgroups-v3
vendor: github.com/containerd/cgroups/v3 v3.0.1
2023-03-08 14:22:24 +01:00
Paweł Gronowski
e528b227a6
Merge pull request #45094 from vvoland/use-typeurl2
libcontainerd: Upgrade to typeurl/v2
2023-03-08 12:41:01 +01:00
Akihiro Suda
e807ae4f2e
vendor: github.com/containerd/cgroups/v3 v3.0.1
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-03-08 20:15:17 +09:00
Paweł Gronowski
44d0522848
c8d/inspect: Add digested reference to details
Fixes `RepoDigests` value being `null` in inspect output.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-08 11:58:07 +01:00
Paweł Gronowski
a8f5c524a0
libcontainerd: Upgrade to typeurl/v2
In preparation for containerd v1.7 which migrates off gogo/protobuf
and changes the protobuf Any type to one that's not supported by our
vendored version of typeurl.

This fixes a compile error on usages of `typeurl.UnmarshalAny` when
upgrading to containerd v1.7.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-08 11:26:32 +01:00
Sebastiaan van Stijn
d7e5708bb4
Merge pull request #44934 from laurazard/c8d-layer-size
containerd integration: compute containers layer size
2023-03-08 08:44:17 +01:00
Laura Brehm
45ee4d7c78
c8d: Compute container's layer size
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-03-08 00:58:02 +01:00
Brian Goff
0bcdbbeedc
Merge pull request #45115 from vvoland/update-shfmt
Dockerfile: Update shfmt to 3.6.0
2023-03-07 21:23:46 +00:00
Sebastiaan van Stijn
7cda1fc4b6
Merge pull request #45103 from vvoland/testlogs-longer-timeout
TestLogs: Increase stop check poll timeout on Windows
2023-03-07 21:36:30 +01:00
Paweł Gronowski
4026148ef1
Dockerfile: Update shfmt to 3.6.0
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-07 15:46:50 +01:00
Paweł Gronowski
a0741cacef
contrib/dockerize-disk.sh: Fix indentation
Reported by shfmt

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-07 15:46:48 +01:00
Sebastiaan van Stijn
088aff1620
vendor: github.com/moby/swarmkit/v2 v2.0.0-20230302163403-80a528a86877
- fix docker service create doesn't work when network and generic-resource are both attached
- Fix removing tasks when a jobs service is removed
- CSI: Allow NodePublishVolume even when plugin does not support staging

full diff: 904c221ac2...80a528a868

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-07 12:08:27 +01:00
Sebastiaan van Stijn
b3428bcf88
Merge pull request #44079 from thaJeztah/c8d_build
containerd integration: Make build work
2023-03-07 11:26:14 +01:00
Tonis Tiigi
f8b468fda2
builder-next: enable more cache backends
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-07 10:32:40 +01:00
Djordje Lukic
bba77163ff
c8d: Make build and buildx work
- Only use the image exporter in build if we don't use containerd
  Without this "docker build" fails with:

    Error response from daemon: exporter "image" could not be found

- let buildx know we support containerd snapshotter
- Pass the current snapshotter to the buildkit worker

  If buildkit uses a different snapshotter we can't list the images any
  more because we can't find the snapshot.

builder/builder-next: make ContainerdWorker a minimal wrapper

Note that this makes "Worker" a public field, so technically one could
overwrite it.

builder-next: reenable runc executor

Currently, without special CNI config the builder would
only create host network containers that is a security issue.

Using runc directly instead of shim is faster as well
as builder doesn’t need anything from shim. The overhead
of setting up network sandbox is much slower of course.

builder/builder-next: simplify options handling

Trying to simplify the logic;

- Use an early return if multiple outputs are provided
- Only construct the list of tags if we're using an image (or moby) exporter
- Combine some logic for snapshotter and non-snapshotter handling

Create a constant for the moby exporter

Pass a context when creating a router

The context has a 10 seconds timeout which should be more than enough to
get the answer from containerd.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Co-authored-by: Tonis Tiigi <tonistiigi@gmail.com>
Co-authored-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Co-authored-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-07 10:01:47 +01:00
Akihiro Suda
f61142cce5
Merge pull request #45109 from thaJeztah/update_buildkit_0.11.4
vendor: github.com/moby/buildkit v0.11.4
2023-03-07 13:59:45 +09:00
Bjorn Neergaard
c55662f247
Merge pull request #45108 from thaJeztah/update_authors
regenerate AUTHORS
2023-03-06 12:46:55 -07:00
Sebastiaan van Stijn
b0b3c62a84
vendor: github.com/moby/buildkit v0.11.4
- provenance: ensure URLs are redacted before written (fixes CVE-2023-26054)

full diff: https://github.com/moby/buildkit/compare/218e934edfba...v0.11.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-06 17:21:15 +01:00
Sebastiaan van Stijn
117cdb28ce
regenerate AUTHORS
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-06 17:11:00 +01:00
Sebastiaan van Stijn
6f719c74a9
Merge pull request #44958 from laurazard/c8d-docker-commit
containerd integration: `docker commit`
2023-03-06 16:25:44 +01:00
Paweł Gronowski
608a122aef
integration: Extract StopContainerWindowsPollTimeout const
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-06 16:21:55 +01:00
Paweł Gronowski
74dbb721aa
TestLogs: Increase stop check poll timeout on Windows
Stopping container on Windows can sometimes take longer than 10s which
caused this test to be flaky.
Increase the timeout to 75s when running this test on Windows.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-06 16:14:38 +01:00
Sebastiaan van Stijn
17f17c284c
Merge pull request #45092 from vvoland/c8d-dangling-filter-upstream
c8d/list: Support dangling filter
2023-03-06 15:38:58 +01:00
Laura Brehm
a34060cdb4
Resolve and store manifest when creating container
This addresses the previous issue with the containerd store where, after a container is created, we can't deterministically resolve which image variant was used to run it (since we also don't store what platform the image was fetched for).

This is required for things like `docker commit`, and computing the containers layer size later, since we need to resolve the specific image variant.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-03-06 15:13:36 +01:00
Nicolas De Loof
168ca2dcc8
Introduce support for docker commit
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
Co-authored-by: Laura Brehm <laurabrehm@hey.com>
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Co-authored-by: Paweł Gronowski <pawel.gronowski@docker.com>
Co-authored-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-03-06 15:11:36 +01:00
Sebastiaan van Stijn
22f303e422
layer: NewStoreFromOptions(): include driver-name in error message
When reading through some bug reports, I noticed that the error-message for
unsupported storage drivers is not very informative, as it does not include
the actual storage driver. Some of these errors are used as sentinel errors
internally, so improving the error returned by graphdriver.New() may need
some additional work, but this patch makes a start by including the name
of the graphdriver (if set) in the error-message.

Before this patch:

    dockerd --storage-driver=foobar
    ...
    failed to start daemon: error initializing graphdriver: driver not supported

With this patch:

    dockerd --storage-driver=foobar
    ...
    failed to start daemon: error initializing graphdriver: driver not supported: foobar

It's worth noting that there may be code "in the wild" that perform string-
matching on this error (e.g. [balena][1]), which is why I included the name as a separate "component"
in the output, to allow matching parts of the error.

[1]: 3d5c77a466/lib/preload.ts (L34-L35)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-06 13:06:16 +01:00
Sebastiaan van Stijn
f52e935f36
reference: add test-coverage for digested references
Trying to overwrite a digest with another digest is not allowed, and
cannot be forced.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-06 13:01:35 +01:00
Sebastiaan van Stijn
f71439d527
reference: don't string-match errors in tests, and fix error format
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-06 13:01:34 +01:00
Sebastiaan van Stijn
669940065f
reference: use t.TempDir() for tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-06 13:01:34 +01:00
Sebastiaan van Stijn
520dc12c0e
reference: rename variables that collided with type / import
These variables collided with the "repository" and "store" types declared
in this package. Rename the variables colliding with "repository", and
rename the "store" type to "refStore".

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-06 13:01:31 +01:00
Sebastiaan van Stijn
293c814688
Merge pull request #45095 from vvoland/vendor-buildkit-0.11.4-pre
vendor: buildkit v0.11.4-0.20230228113103-218e934edfba
2023-03-03 16:32:04 +01:00
Paweł Gronowski
c477cda59f
c8d/list: Support dangling filter
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-03 16:21:29 +01:00
Paweł Gronowski
3e4c4df664
builder/exporter: Remove commented unused const
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-03 11:05:07 +01:00
Paweł Gronowski
324290a5eb
vendor: buildkit v0.11.4-0.20230228113103-218e934edfba
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-03 11:05:05 +01:00
Sebastiaan van Stijn
de90b5e9ad
Merge pull request #45097 from vvoland/remove-buildinfo
builder: Remove buildkit's build information
2023-03-02 21:46:15 +01:00
Sebastiaan van Stijn
11261594d8
Merge pull request #45032 from corhere/shim-opts
daemon: allow shimv2 runtimes to be configured
2023-03-02 21:45:05 +01:00
Cory Snider
e3215702ae
Merge pull request #44968 from corhere/libnet/ipam-cleanup
libnetwork/ipam: refactor all the things
2023-03-02 15:28:53 -05:00
Sebastiaan van Stijn
2323f9deda
Merge pull request #43197 from dajudge/default-bridge-mtu
Introduce config option for default generic network options of newly created networks
2023-03-02 20:21:47 +01:00
Sebastiaan van Stijn
9822185d53
Merge pull request #44989 from laurazard/c8d-multi-arch-images
containerd integration: handle multi-platform images
2023-03-02 20:16:14 +01:00
Paweł Gronowski
6588b3eef0
builder: Remove buildkit's build information
Buildkit deprecated build information in v0.11 and will remove it in v0.12.
It's suggested to use provenance attestations instead.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-02 19:17:11 +01:00
Brian Goff
a026f3be4b
Merge pull request #45091 from corhere/remove-authz-middleware-from-config
daemon/config: remove AuthzMiddleware field
2023-03-02 17:51:06 +00:00
Laura Brehm
4ea1c9f8e5
docker image ls: handle multi-platform images
Multiple entries are returned for each platform of an image

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-03-02 11:07:19 +01:00
Akihiro Suda
e068c38618
Merge pull request #45085 from thaJeztah/vendor_containerd_1.6.19
vendor: github.com/Microsoft/hcsshim v0.9.7, github.com/containerd/containerd v1.6.19
2023-03-02 11:12:13 +09:00
Sebastiaan van Stijn
7aa36717bb
Merge pull request #45090 from vvoland/libcontainerd-nil-checkpoint
libcontainerd/client: Fix checkpoint not being set
2023-03-01 17:57:31 +01:00
Cory Snider
fb5df9722b
Merge pull request #45088 from corhere/make-apiserver-less-weird
api/server: delete Wait method
2023-03-01 10:14:09 -05:00
Cory Snider
a9e7360775 daemon/config: remove AuthzMiddleware field
The authorization.Middleware contains a sync.Mutex field, making it
non-copyable. Remove one of the barriers to allowing deep copies of
config.Config values.

Inject the middleware into Daemon as a constructor argument instead.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-03-01 09:43:39 -05:00
Cory Snider
7568bbc491
Merge pull request #45083 from corhere/unused-api-config-struct
api/server: drop unused Config struct
2023-03-01 09:38:18 -05:00
Cory Snider
e979518a69
Merge pull request #45087 from corhere/fix-registry-config-locking
registry: acquire mutex in IsInsecureRegistry
2023-03-01 09:10:25 -05:00
Paweł Gronowski
47e9caede7
libcontainerd/client: Rename cp to checkpoint
Make the variable longer to give a hint about it's broader scope.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-01 15:07:58 +01:00
Paweł Gronowski
0c751f904f
libcontainerd/client: Fix checkpoint not being set
`cp` variable is used later to populate the `info.Checkpoint` field
option used by Task creation.
Previous changes mistakenly changed assignment of the `cp` variable to
declaration of a new variable that's scoped only to the if block.

Restore the old assignment behavior.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-01 15:07:42 +01:00