Commit graph

45693 commits

Author SHA1 Message Date
Sebastiaan van Stijn
a2c29e9128
update containerd binary to v1.7.0
- release notes: https://github.com/containerd/containerd/releases/tag/v1.7.0
- full diff: https://github.com/containerd/containerd/compare/v1.7.0-beta.4...v1.7.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-12 16:09:33 +01:00
Sebastiaan van Stijn
2fa66cfce2
Merge pull request #45116 from thaJeztah/c8d_GetLayerByID
remove GetLayerByID from ImageService interface
2023-03-10 18:59:33 +01:00
Nicolas De Loof
06619763a2
remove GetLayerByID from ImageService interface
Co-authored-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Co-authored-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-10 17:54:55 +01:00
Sebastiaan van Stijn
a1f6a70522
Merge pull request #45135 from thaJeztah/bump_go1.20.2
update to go1.20.2
2023-03-10 13:26:43 +01:00
Sebastiaan van Stijn
1816fb66c7
Merge pull request #45123 from vvoland/c8d-upstream-build-dangling
c8d/builder: Store untagged images as dangling
2023-03-10 13:25:37 +01:00
Sebastiaan van Stijn
02dec48bab
update to go1.20.2
Includes a security fix for crypto/elliptic (CVE-2023-24532).

> go1.20.2 (released 2023-03-07) includes a security fix to the crypto/elliptic package,
> as well as bug fixes to the compiler, the covdata command, the linker, the runtime, and
> the crypto/ecdh, crypto/rsa, crypto/x509, os, and syscall packages.
> See the Go 1.20.2 milestone on our issue tracker for details.

https://go.dev/doc/devel/release#go1.20.minor

From the announcement:

> We have just released Go versions 1.20.2 and 1.19.7, minor point releases.
>
> These minor releases include 1 security fixes following the security policy:
>
> - crypto/elliptic: incorrect P-256 ScalarMult and ScalarBaseMult results
>
>   The ScalarMult and ScalarBaseMult methods of the P256 Curve may return an
>   incorrect result if called with some specific unreduced scalars (a scalar larger
>   than the order of the curve).
>
>   This does not impact usages of crypto/ecdsa or crypto/ecdh.
>
> This is CVE-2023-24532 and Go issue https://go.dev/issue/58647.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-10 10:18:11 +01:00
Bjorn Neergaard
40ff225b8e
Merge pull request #45132 from cpuguy83/fix_listener_regression
Fix listener parsering regression when no addr set
2023-03-09 17:47:57 -07:00
Brian Goff
37a9d6aabe Fix listener parsering regression when no addr set
5008409b5c introduced the usage of
`strings.Cut` to help parse listener addresses.
Part of that also made it error out if no addr is specified after the
protocol spec (e.g. `tcp://`).

Before the change a proto spec without an address just used the default
address for that proto.
e.g. `tcp://` would be `tcp://127.0.0.1:2375`, `unix://` would be
`unix:///var/run/docker.sock`.
Critically, socket activation (`fd://`) never has an address.

This change brings back the old behavior but keeps the usage of
`strings.Cut`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-03-09 23:53:05 +00:00
Sebastiaan van Stijn
c7d2c2aa9f
Merge pull request #45130 from thaJeztah/bump_swarmkit
vendor: github.com/moby/swarmkit/v2 v2.0.0-20230309194213-a745a8755ce3
2023-03-09 23:24:50 +01:00
Sebastiaan van Stijn
3bbffe96e1
vendor: github.com/moby/swarmkit/v2 v2.0.0-20230309194213-a745a8755ce3
no changes in vendored code; only aligning dependencies

full diff: 80a528a868...a745a8755c

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-09 22:20:59 +01:00
Sebastiaan van Stijn
6f14c8ee5a
Merge pull request #44894 from thaJeztah/better_graphdriver_error
layer: NewStoreFromOptions(): include driver-name in error message
2023-03-09 12:44:23 +01:00
Sebastiaan van Stijn
06d843c2c4
Merge pull request #44732 from thaJeztah/fix_store
reference: assorted fixes and cleanups
2023-03-09 12:43:56 +01:00
Paweł Gronowski
af677245fb
c8d/builder: Store untagged images as dangling
Set `dangling-name-prefix` exporter attribute  to `moby-dangling` which
makes it create an containerd image even when user didn't provide any
name for the new image.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-08 16:59:33 +01:00
Paweł Gronowski
8f716ca06a
builder/overrides: Add consts for attribute key names
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-08 16:59:26 +01:00
Sebastiaan van Stijn
ad9d70b0e6
Merge pull request #45106 from thaJeztah/bump_swarmkit
vendor: github.com/moby/swarmkit/v2 v2.0.0-20230302163403-80a528a86877
2023-03-08 15:08:43 +01:00
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
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