Commit graph

7583 commits

Author SHA1 Message Date
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
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
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
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
9bc78bdc5b
Merge pull request #45289 from vvoland/c8d-label-filter
c8d/list: Fix `label` (and add `label!`) filter
2023-04-13 18:01:23 +02:00
Sebastiaan van Stijn
93e5c99fff
Merge pull request #45324 from vvoland/image-children-error
images/Children: Return error
2023-04-13 18:00:47 +02:00
Sebastiaan van Stijn
9b83875c13
Merge pull request #45300 from thaJeztah/errdefs_alias
use consistent alias for containerd's errdefs package, and validate in CI
2023-04-13 16:20:49 +02:00
Paweł Gronowski
9cb5da400c
images/Children: Return error
Change return value in function signature and return fatal errors so
they can actually be reported to the caller instead of just being logged
to daemon log.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-13 16:20:02 +02:00
Sebastiaan van Stijn
45483a1d0d
Merge pull request #45299 from thaJeztah/cleanup_stats
daemon: move code related to stats together
2023-04-13 16:16:47 +02:00
Paweł Gronowski
edf802956e
c8d/list: Implement label and label! filter
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-13 15:39:52 +02:00
Sebastiaan van Stijn
5a922dc162
daemon: deprecate --oom-score-adjust for the daemon
The `oom-score-adjust` option was added in a894aec8d8,
to prevent the daemon from being OOM-killed before other processes. This
option was mostly added as a "convenience", as running the daemon as a
systemd unit was not yet common.

Having the daemon set its own limits is not best-practice, and something
better handled by the process-manager starting the daemon.

Commit cf7a5be0f2 fixed this option to allow
disabling it, and 2b8e68ef06 removed the default
score adjust.

This patch deprecates the option altogether, recommending users to set these
limits through the process manager used, such as the "OOMScoreAdjust" option
in systemd units.

With this patch:

    dockerd --oom-score-adjust=-500 --validate
    Flag --oom-score-adjust has been deprecated, and will be removed in the next release.
    configuration OK

    echo '{"oom-score-adjust":-500}' > /etc/docker/daemon.json
    dockerd
    INFO[2023-04-12T21:34:51.133389627Z] Starting up
    INFO[2023-04-12T21:34:51.135607544Z] containerd not running, starting managed containerd
    WARN[2023-04-12T21:34:51.135629086Z] DEPRECATED: The "oom-score-adjust" config parameter and the dockerd "--oom-score-adjust" option will be removed in the next release.

    docker info
    Client:
      Context:    default
      Debug Mode: false
    ...
    DEPRECATED: The "oom-score-adjust" config parameter and the dockerd "--oom-score-adjust" option will be removed in the next release

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-13 00:02:39 +02:00
Djordje Lukic
f696a1b3b3
Fix error checking when pulling from an insecure registry
The call to an unsecure registry doesn't return an error saying that the
"server gave an HTTP response to an HTTPS client" but a
tls.RecordHeaderError saying that the "first record does not look like a
TLS handshake", this changeset looks for the right error for that case.

This fixes the http fallback when using an insecure registry

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2023-04-12 21:56:52 +02:00
Sebastiaan van Stijn
860db986fc
Merge pull request #45267 from rumpl/c8d-fix-exec-user
c8d: Set the process user on exec
2023-04-11 16:03:40 +02:00
Sebastiaan van Stijn
74a0fdf961
Merge pull request #45265 from vvoland/c8d-children-upstream
c8d: Implement Children by comparing diff ids
2023-04-11 15:45:27 +02:00
Sebastiaan van Stijn
a5d46a15f5
split GetRepository from ImageService
The GetRepository method interacts directly with the registry, and does
not depend on the snapshotter, but is used for two purposes;

For the GET /distribution/{name:.*}/json route;
dd3b71d17c/api/server/router/distribution/backend.go (L11-L15)

And to satisfy the "executor.ImageBackend" interface as used by Swarm;
58c027ac8b/daemon/cluster/executor/backend.go (L77)

This patch removes the method from the ImageService interface, and instead
implements it through an composite struct that satisfies both interfaces,
and an ImageBackend() method is added to the daemon.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

remove GetRepository from ImageService

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-09 12:07:57 +02:00
Sebastiaan van Stijn
81e62af94a
use consistent alias for containerd's errdefs package
The signatures of functions in containerd's errdefs packages are very
similar to those in our own, and it's easy to accidentally use the wrong
package.

This patch uses a consistent alias for all occurrences of this import.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-08 19:30:33 +02:00
Sebastiaan van Stijn
f691b13450
daemon: move code related to stats together
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-08 19:00:01 +02:00
Sebastiaan van Stijn
5c78cbd3be
pkg/platform: deprecate OSType in favor or runtime.GOOS
This const looks to only be there for "convenience", or _possibly_ was created
with future normalization or special handling in mind.

In either case, currently it is just a direct copy (alias) for runtime.GOOS,
and defining our own type for this gives the impression that it's more than
that. It's only used in a single place, and there's no external consumers, so
let's deprecate this const, and use runtime.GOOS instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-08 14:57:33 +02:00
Djordje Lukic
41a230758c
c8d: Set the process user on exec
This change makes is possible to run `docker exec -u <UID> ...` when the
containerd integration is activated.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2023-04-07 10:53:25 +02:00
Sebastiaan van Stijn
79bf167c0d
Merge pull request #45269 from vvoland/c8d-reference-filter
c8d/list: Implement `reference`
2023-04-06 23:30:55 +02:00
Paweł Gronowski
e0f36f9d8b
ImageService: Pass ctx to Children
This only makes the containerd ImageService implementation respect
context cancellation though.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-06 14:27:38 +02:00
Paweł Gronowski
bea751beb7
c8d: Implement Children by comparing diff ids
Implement Children method for containerd image store which makes the
`ancestor` filter work for `docker ps`. Checking if image is a children
of other image is implemented by comparing their rootfs diffids because
containerd image store doesn't have a concept of image parentship like
the graphdriver store. The child is expected to have more layers than
the parent and should start with all parent layers.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-06 14:27:37 +02:00
Paweł Gronowski
ba47cdcc0b
c8d/list: Implement reference filter
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-06 13:44:52 +02:00
Sebastiaan van Stijn
e8a79114b8
Merge pull request #45274 from thaJeztah/container_as_source_of_truth
c8d: use the container's configured snapshotter where possible
2023-04-05 17:03:18 +02:00
Sebastiaan van Stijn
465cbccdaf
c8d: use the container's configured snapshotter where possible
While we currently do not provide an option to specify the snapshotter to use
for individual containers (we may want to add this option in future), currently
it already is possible to configure the snapshotter in the daemon configuration,
which could (likely) cause issues when changing and restarting the daemon.

This patch updates some code-paths that have the container available to use
the snapshotter that's configured for the container (instead of the default
snapshotter configured).

There are still code-paths to be looked into, and a tracking ticket as well as
some TODO's were added for those.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-05 14:09:21 +02:00
Sebastiaan van Stijn
c2c83e16a2
Merge pull request #45266 from rumpl/c8d-tag-delete-events
c8d: Send an event when an image is tagged or deleted
2023-04-05 09:10:43 +02:00
Wesley Pettit
c8f8d11ac4
awslogs: fix non-blocking log drop bug
Previously, the AWSLogs driver attempted to implement
non-blocking itself. Non-blocking is supposed to
implemented solely by the Docker RingBuffer that
wraps the log driver.

Please see issue and explanation here:
https://github.com/moby/moby/issues/45217

Signed-off-by: Wesley Pettit <wppttt@amazon.com>
2023-04-04 17:03:06 -07:00
Djordje Lukic
1b178dffa3
Send an event when an image is deleted
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2023-04-04 15:54:11 +02:00
Djordje Lukic
36d28b73fc
Send an event when an image is tagged
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2023-04-04 11:32:02 +02:00
Cory Snider
750218c5e5 d/config: fix default-network-opts in daemon.json
Prevent the daemon from erroring out if daemon.json contains default
network options for network drivers aside from bridge. Configuring
defaults for the bridge driver previously worked by coincidence because
the unrelated CLI flag '--bridge' exists.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-04-03 15:59:53 -04:00
Sebastiaan van Stijn
816cd9802f
Merge pull request #45259 from rumpl/c8d-load-save-events
c8d: Send event when an image is imported
2023-04-03 20:05:45 +02:00
Sebastiaan van Stijn
781740c19d
Merge pull request #45124 from vvoland/c8d-list-ignore-attestations
c8d/list: Ignore attestation manifests
2023-04-03 19:56:29 +02:00
Paweł Gronowski
92e38b6e27
c8d/list: Ignore attestation manifests
Attestation manifests have an OCI image media type, which makes them
being listed like they were a separate platform supported by the image.

Don't use `images.Platforms` and walk the manifest list ourselves
looking for all manifests that are an actual image manifest.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-03 17:50:56 +02:00
Djordje Lukic
773a9d85a1
c8d: Send event when an image is exported
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2023-04-03 15:30:04 +02:00
Djordje Lukic
00545ef4d6
c8d: Send event when an image is imported
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2023-04-03 15:21:18 +02:00
Sebastiaan van Stijn
348f83670a
Merge pull request #45249 from vvoland/c8d-push-upstream-2
c8d/push: Follow up fixes
2023-03-31 22:37:59 +02:00
Sebastiaan van Stijn
126e212fb0
Merge pull request #45243 from thaJeztah/c8d_push_nits
c8d: push: addressing some nits
2023-03-31 19:28:43 +02:00
Paweł Gronowski
027f70562e
c8d/push: Rename jobs to avoid shadowing type
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-31 16:30:14 +02:00
Paweł Gronowski
e1dd9c0396
c8d/push: Ignore :port when comparing source repository
Distribution source labels don't store port of the repository. If the
content was obtained from repository 172.17.0.2:5000 then its
corresponding label will have a key "containerd.io/distribution.source.172.17.0.2".

Fix the check in canBeMounted to ignore the :port part of the domain.

This also removes the check which prevented insecure repositories to use
cross-repo mount - the real cause was the mismatch in domain comparison.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-31 16:30:11 +02:00
Paweł Gronowski
4a34c501c1
c8d/push: Parse source labels with multiple sources
Distribution source label can specify multiple repositories - in this
case value is a comma separated list of source repositories.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-31 16:30:09 +02:00
Paweł Gronowski
cb788bea9c
c8d/push: Add distribution source labels only on success
Previously the labels would be appended for content that was pushed
even if subsequent pushes of other content failed.
Change the behavior to only append the labels if the whole push
operation succeeded.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-31 16:30:08 +02:00
Paweł Gronowski
013e44ec5d
c8d/push: Log error if releasing the lease failed
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-31 16:30:06 +02:00
Paweł Gronowski
c9012c798e
c8d/push: Sync mountableBlobs access
Handler is called in parallel and modifying a map without
synchronization is a race condition.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-31 16:30:03 +02:00
Sebastiaan van Stijn
7c93e4a09b
Merge pull request #45241 from rumpl/c8d-image-events
c8d: Add the events services to the containerd image service
2023-03-31 00:31:04 +02:00
Sebastiaan van Stijn
a0ef2ac59c
c8d: push: addressing some nits
- make jobs.Add accept a list of jobs, so that we don't have to
  repeatedly lock/unlock the mutex
- rename some variables that collided with imports or types

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-31 00:23:09 +02:00
Tianon Gravi
f537ef5746
Merge pull request #44963 from vvoland/c8d-push-upstream
c8d: Implement push
2023-03-30 14:43:41 -07:00
Sebastiaan van Stijn
0656059ae7
Merge pull request #45122 from vvoland/c8d-upstream-inspect-digest
c8d/inspect: Add digested reference to details
2023-03-30 22:53:12 +02:00
Sebastiaan van Stijn
49d1e1c9b1
Merge pull request #45231 from vvoland/c8d-inspect-dangling
c8d/inspect: Handle dangling images
2023-03-30 22:26:52 +02:00
Sebastiaan van Stijn
f7b6aefe0e
Merge pull request #44964 from laurazard/c8d-docker-diff
containerd integration: `docker diff`
2023-03-30 20:58:54 +02:00
Paweł Gronowski
a75354c045
c8d: Implement push
This implements `docker push` under containerd image store.  When
pushing manifest lists that reference a content which is not present in
the local content store, it will attempt to perform the cross-repo mount
the content if possible.

Considering this scenario:

```bash
$ docker pull docker.io/library/busybox
```
This will download manifest list and only host platform-specific
manifest and blobs.

Note, tagging to a different repository (but still the same registry) and pushing:
```bash
$ docker tag docker.io/library/busybox docker.io/private-repo/mybusybox
$ docker push docker.io/private-repo/mybusybox
```

will result in error, because the neither we nor the target repository
doesn't have the manifests that the busybox manifest list references
(because manifests can't be cross-repo mounted).

If for some reason the manifests and configs for all other platforms
would be present in the content store, but only layer blobs were
missing, then the push would work, because the blobs can be cross-repo
mounted (only if we push to the same registry).

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-30 19:53:02 +02:00
Paweł Gronowski
e7393d0fc5
images/push: Accept reference
Push the reference parsing from repo and tag names into the api and pass
a reference object to the ImageService.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-30 18:08:40 +02:00
Djordje Lukic
15b9176d53
Add the events services to the containerd image service
No events are sent yet, these will come at a later stage.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2023-03-30 17:48:51 +02:00
Paweł Gronowski
24804e67f5
c8d/commit: Use manifest digest for dangling image
Previously commit incorrectly used image config digest as an image id
for the new image which isn't consistent with the image target.
This changes it to use manifest digest.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-30 14:13:13 +02:00
Laura Brehm
4c459ddabd
c8d: add support for docker diff
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-03-30 10:29:07 +01:00
Paweł Gronowski
f09b1022aa
c8d/inspect: Handle dangling images
Don't try to parse dangling images name (they have a non-canonical
format - `moby-dangling@sha256:...`) as a reference.
Log a warning if the image is not dangling and its name is not a valid
named reference.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-30 10:34:38 +02: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
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
Bjorn Neergaard
1c84f63a40
Merge pull request #45086 from corhere/search-in-registry-service
Move filtered registry search out of the image service
2023-03-15 07:52:42 -06:00
Sebastiaan van Stijn
3b569cc686
daemon/graphdriver/windows: cleanup errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-14 23:00:48 +01:00
Sebastiaan van Stijn
bbeaeee3c7
daemon/graphdriver/windows: remove some intermediate variables
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-14 23:00:48 +01:00
Sebastiaan van Stijn
9db5dc9a46
daemon/graphdriver/windows: use strings.EqualFold()
Saves some allocations

    BenchmarkTolower
    BenchmarkTolower-5     7917788       150.4 ns/op      16 B/op       3 allocs/op
    BenchmarkEqualFold
    BenchmarkEqualFold-5   8248605       143.5 ns/op       8 B/op       1 allocs/op

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-14 23:00:48 +01:00
Sebastiaan van Stijn
d742188e3b
daemon/graphdriver/windows: remove fileFlagSequentialScan const
Replace it with the const that's now defined in golang.org/x/sys/windows

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-14 23:00:47 +01:00
Sebastiaan van Stijn
3a8c97be45
daemon/graphdriver/windows: rename vars that collided with imports
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-14 23:00:47 +01:00
Sebastiaan van Stijn
605e8f53b1
daemon/graphdriver/windows: InitFilter() don't use idtools.MkdirAllAndChown()
idtools.MkdirAllAndChown on Windows does not chown directories, which makes
idtools.MkdirAllAndChown() just an alias for system.MkDirAll().

Also setting the filemode to `0`, as changing filemode is a no-op on Windows as
well; both of these changes should make it more transparent that no chown'ing,
nor changing filemode takes place.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-14 23:00:44 +01:00
Brian Goff
146df5fbd3
Fix pruning anon volume created from image config
Volumes created from the image config were not being pruned because the
volume service did not think they were anonymous since the code to
create passes along a generated name instead of letting the volume
service generate it.

This changes the code path to have the volume service generate the name
instead of doing it ahead of time.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-03-14 11:06:26 +01:00
Sebastiaan van Stijn
058a31e479
volumes: fix error-handling when removing volumes with swarm enabled
Commit 3246db3755 added handling for removing
cluster volumes, but in some conditions, this resulted in errors not being
returned if the volume was in use;

    docker swarm init
    docker volume create foo
    docker create -v foo:/foo busybox top
    docker volume rm foo

This patch changes the logic for ignoring "local" volume errors if swarm
is enabled (and cluster volumes supported).

While working on this fix, I also discovered that Cluster.RemoveVolume()
did not handle the "force" option correctly; while swarm correctly handled
these, the cluster backend performs a lookup of the volume first (to obtain
its ID), which would fail if the volume didn't exist.

Before this patch:

    make TEST_FILTER=TestVolumesRemoveSwarmEnabled DOCKER_GRAPHDRIVER=vfs test-integration
    ...
    Running /go/src/github.com/docker/docker/integration/volume (arm64.integration.volume) flags=-test.v -test.timeout=10m  -test.run TestVolumesRemoveSwarmEnabled
    ...
    === RUN   TestVolumesRemoveSwarmEnabled
    === PAUSE TestVolumesRemoveSwarmEnabled
    === CONT  TestVolumesRemoveSwarmEnabled
    === RUN   TestVolumesRemoveSwarmEnabled/volume_in_use
        volume_test.go:122: assertion failed: error is nil, not errdefs.IsConflict
        volume_test.go:123: assertion failed: expected an error, got nil
    === RUN   TestVolumesRemoveSwarmEnabled/volume_not_in_use
    === RUN   TestVolumesRemoveSwarmEnabled/non-existing_volume
    === RUN   TestVolumesRemoveSwarmEnabled/non-existing_volume_force
        volume_test.go:143: assertion failed: error is not nil: Error response from daemon: volume no_such_volume not found
    --- FAIL: TestVolumesRemoveSwarmEnabled (1.57s)
        --- FAIL: TestVolumesRemoveSwarmEnabled/volume_in_use (0.00s)
        --- PASS: TestVolumesRemoveSwarmEnabled/volume_not_in_use (0.01s)
        --- PASS: TestVolumesRemoveSwarmEnabled/non-existing_volume (0.00s)
        --- FAIL: TestVolumesRemoveSwarmEnabled/non-existing_volume_force (0.00s)
    FAIL

With this patch:

    make TEST_FILTER=TestVolumesRemoveSwarmEnabled DOCKER_GRAPHDRIVER=vfs test-integration
    ...
    Running /go/src/github.com/docker/docker/integration/volume (arm64.integration.volume) flags=-test.v -test.timeout=10m  -test.run TestVolumesRemoveSwarmEnabled
    ...
    make TEST_FILTER=TestVolumesRemoveSwarmEnabled DOCKER_GRAPHDRIVER=vfs test-integration
    ...
    Running /go/src/github.com/docker/docker/integration/volume (arm64.integration.volume) flags=-test.v -test.timeout=10m  -test.run TestVolumesRemoveSwarmEnabled
    ...
    === RUN   TestVolumesRemoveSwarmEnabled
    === PAUSE TestVolumesRemoveSwarmEnabled
    === CONT  TestVolumesRemoveSwarmEnabled
    === RUN   TestVolumesRemoveSwarmEnabled/volume_in_use
    === RUN   TestVolumesRemoveSwarmEnabled/volume_not_in_use
    === RUN   TestVolumesRemoveSwarmEnabled/non-existing_volume
    === RUN   TestVolumesRemoveSwarmEnabled/non-existing_volume_force
    --- PASS: TestVolumesRemoveSwarmEnabled (1.53s)
        --- PASS: TestVolumesRemoveSwarmEnabled/volume_in_use (0.00s)
        --- PASS: TestVolumesRemoveSwarmEnabled/volume_not_in_use (0.01s)
        --- PASS: TestVolumesRemoveSwarmEnabled/non-existing_volume (0.00s)
        --- PASS: TestVolumesRemoveSwarmEnabled/non-existing_volume_force (0.00s)
    PASS

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-13 19:17:35 +01:00
Cory Snider
7b3acdff5d registry: return concrete service type
Move interface definitions to the packages which use the registry
service.

https://github.com/golang/go/wiki/CodeReviewComments#interfaces

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-03-10 18:38:08 -05:00
Cory Snider
3991faf464 Move filtered registry search out of image service
SearchRegistryForImages does not make sense as part of the image
service interface. The implementation just wraps the search API of the
registry service to filter the results client-side. It has nothing to do
with local image storage, and the implementation of search does not need
to change when changing which backend (graph driver vs. containerd
snapshotter) is used for local image storage.

Filtering of the search results is an implementation detail: the
consumer of the results does not care which actor does the filtering so
long as the results are filtered as requested. Move filtering into the
exported API of the registry service to hide the implementation details.
Only one thing---the registry service implementation---would need to
change in order to support server-side filtering of search results if
Docker Hub or other registry servers were to add support for it to their
APIs.

Use a fake registry server in the search unit tests to avoid having to
mock out the registry API client.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-03-10 18:36:33 -05: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
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
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
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
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
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
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
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
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
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
Alex Stockinger
91c2b12205 Make default options for newly created networks configurable
Signed-off-by: Alex Stockinger <alex@atomicjar.com>
Co-authored-by: Sergei Egorov <bsideup@gmail.com>
Co-authored-by: Cory Snider <corhere@gmail.com>
2023-03-01 07:58:26 +01:00
Paweł Gronowski
248745004a
api: Remove <none> in Repo(Tags|Digests) for >= 1.43
Deprecate `<none>:<none>` and `<none>@<none>` magic strings included in
`RepoTags` and `RepoDigests`.
Produce an empty arrays instead and leave the presentation of
untagged/dangling images up to the client.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-02-27 19:44:43 +01:00
Brian Goff
0021339b92
Merge pull request #45025 from corhere/oci-annotation-passthru 2023-02-24 16:27:11 +00:00
Cory Snider
0ffaa6c785 daemon: add annotations to container HostConfig
Allow clients to set annotations on a container which will applied to
the container's OCI spec.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-23 18:59:00 -05:00
Bjorn Neergaard
a9f17a28db
Merge pull request #44840 from vvoland/c8d-list-dangling-upstream
c8d/list: Fix Repo(Digests|Tags) for untagged images
2023-02-23 14:25:03 -07:00
Paweł Gronowski
f8791db4be
c8d/list: Fix Repo(Digests|Tags) for untagged images
Show dangling images in `docker image ls` output.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-02-23 19:54:21 +01:00
Brian Goff
73db49f8ef
Merge pull request #44003 from vvoland/invalidfilter 2023-02-22 16:24:47 +00:00
Paweł Gronowski
2f9e3cca3d
api: Move Repo(Digests|Tags) <none> fallback from daemon
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-02-22 17:08:45 +01:00
Sebastiaan van Stijn
99a65dc93e
Merge pull request #45055 from vvoland/c8d-tag-fix-createderr
c8d/tag: Don't create a separate error variable
2023-02-22 13:13:46 +01:00
Paweł Gronowski
8657c87c8c
c8d/tag: Don't create a separate error variable
Checking if the image creation failed due to IsAlreadyExists didn't use
the error from ImageService.Create.
Error from ImageService.Create was stored in a separate variable and
later IsAlreadyExists checked the standard `err` variable instead of the
`createErr`.
As there's no need to store the error in a separate variable - just
assign it to err variable and fix the check.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-02-22 10:09:23 +01:00
Bjorn Neergaard
782a369f92
c8d/pull: Add CRI-compatible annotation of pulled content
Co-authored-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-02-21 08:35:52 -07:00
Cory Snider
b0eed5ade6 daemon: allow shimv2 runtimes to be configured
Kubernetes only permits RuntimeClass values which are valid lowercase
RFC 1123 labels, which disallows the period character. This prevents
cri-dockerd from being able to support configuring alternative shimv2
runtimes for a pod as shimv2 runtime names must contain at least one
period character. Add support for configuring named shimv2 runtimes in
daemon.json so that runtime names can be aliased to
Kubernetes-compatible names.

Allow options to be set on shimv2 runtimes in daemon.json.

The names of the new daemon runtime config fields have been selected to
correspond with the equivalent field names in cri-containerd's
configuration so that users can more easily follow documentation from
the runtime vendor written for cri-containerd and apply it to
daemon.json.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-17 18:08:06 -05:00
Bjorn Neergaard
c4c54683a9
Revert "apparmor: Check if apparmor_parser is available"
This reverts commit ab3fa46502.

This fix was partial, and is not needed with the proper fix in
containerd.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-02-16 08:26:25 -07:00
Cory Snider
efb6950299
Merge pull request #45007 from corhere/fix-ineffective-add
daemon/logger/awslogs: fix ineffective Add in test
2023-02-15 15:48:43 -05:00
Cory Snider
e66995d840 d/l/awslogs: fix ineffective Add in test
...flagged by golangci-lint v1.51.1 (staticcheck).

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-15 13:11:55 -05:00
Cory Snider
713e02e03e daemon: handle EISDIR error from runtime
Go 1.20 made a change to the behaviour of package "os/exec" which was
not mentioned in the release notes:
2b8f214094
Attempts to execute a directory now return syscall.EISDIR instead of
syscall.EACCESS. Check for EISDIR errors from the runtime and fudge the
returned error message to maintain compatibility with existing versions
of docker/cli when using a version of runc compiled with Go 1.20+.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-15 13:06:04 -05:00
Paweł Gronowski
62be425bcc
api: Extract parsing reference from repo and tag
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-02-07 15:43:58 +01:00
Paweł Gronowski
afc6e3fa46
c8d/import: Use danglingImageName instead of hardcoded
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-02-07 15:43:56 +01:00
Paweł Gronowski
eaa56afda9
daemon/c8d: Implement TagImageWithReference
Implements image tagging under containerd image store.

If an image with this tag already exists, and there's no other image
with the same target, change its name. The name will have a special
format `moby-dangling@<digest>` which isn't a valid canonical reference
and doesn't resolve to any repository.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-02-07 15:43:53 +01:00
Paweł Gronowski
1ca85e835c
daemon/imageService: Remove TagImageWithReference
TagImage is just a wrapper for TagImageWithReference which parses the
repo and tag into a reference. Change TagImageWithReference into
TagImage and move the responsibility of reference parsing to caller.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-02-07 15:43:52 +01:00
Nicolas De Loof
7b6f71dced
daemon: Pass ctx to image tagging operations
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-02-07 15:43:48 +01:00
Sebastiaan van Stijn
b5568723ce
Merge pull request #44902 from vvoland/apparmor-check-binary
apparmor: Check if apparmor_parser is available
2023-02-07 11:26:24 +01:00
Paweł Gronowski
ab3fa46502
apparmor: Check if apparmor_parser is available
`hostSupports` doesn't check if the apparmor_parser is available.
It's possible in some environments that the apparmor will be enabled but
the tool to load the profile is not available which will cause the
ensureDefaultAppArmorProfile to fail completely.

This patch checks if the apparmor_parser is available. Otherwise the
function returns early, but still logs a warning to the daemon log.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-02-07 09:39:08 +01:00
Djordje Lukic
0137446248 Implement run using the containerd snapshotter
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>

c8d/daemon: Mount root and fill BaseFS

This fixes things that were broken due to nil BaseFS like `docker cp`
and running a container with workdir override.

This is more of a temporary hack than a real solution.
The correct fix would be to refactor the code to make BaseFS and LayerRW
an implementation detail of the old image store implementation and use
the temporary mounts for the c8d implementation instead.
That requires more work though.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>

daemon/images: Don't unset BaseFS

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-02-06 18:21:50 +01:00
Bjorn Neergaard
3bcb350711
graphdriver/overlay2: usingMetacopy ENOTSUP is non-fatal
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-02-03 05:10:53 -07:00
Bjorn Neergaard
0de32693d0
Merge pull request #44888 from corhere/fix-kata-exec-exit
Fix exit-event handling for Kata runtime
2023-02-02 18:42:22 -07:00
Brian Goff
4c0d75bc8e
Merge pull request #44833 from vvoland/c8d-saveload-upstream
daemon/c8d: Implement save and load
2023-02-02 12:45:42 -08:00
Paweł Gronowski
af32603ae3
daemon/c8d: Implement save and load
This makes the `docker save` and `docker load` work with the containerd
image store. The archive is both OCI and Docker compatible.

Saved archive will only contain content which is available locally.  In
case the saved image is a multi-platform manifest list, the behavior
depends on the local availability of the content. This is to be
reconsidered when we have the `--platform` option in the CLI.

- If all manifests and their contents, referenced by the manifest list
  are present, then the manifest-list is exported directly and the ID
will be the same.
- If only one platform manifest is present, only that manifest is
  exported (the image id will change and will be the id of
platform-specific manifest, instead of the full manifest list).
- If multiple, but not all, platform manifests are available, a new
  manifest list will be created which will be a subset of the original
manifest list.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-02-02 17:42:03 +01:00
Tonis Tiigi
666334bd48
vendor: update buildkit to v0.11.2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-02-01 23:29:10 -08:00
Cory Snider
0e4d3feb94 daemon: identify container exits by ProcessID
The Pid field of an exit event cannot be relied upon to differentiate
exits of the container's task from exits of other container processes,
i.e. execs. The Pid is reported by the runtime and is implementation-
defined so there is no guarantee that a task's pid is distinct from the
pids of any other process in the same container. In particular,
kata-containers reports the pid of the hypervisor for all exit events.
ContainerD guarantees that the process ID of a task is set to the
corresponding container ID, so use that invariant to distinguish task
exits from other process exits.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-31 17:02:43 -05:00
Cory Snider
d634ae9b60 Wait longer for exit events on Windows
The latest version of containerd-shim-runhcs-v1 (v0.10.0-rc.4) pulled in
with the bump to ContainerD v1.7.0-rc.3 had several changes to make it
more robust, which had the side effect of increasing the worst-case
amount of time it takes for a container to exit in the worst case.
Notably, the total timeout for shutting down a task increased from 30
seconds to 60! Increase the timeouts hardcoded in the daemon and
integration tests so that they don't give up too soon.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-31 15:19:08 -05:00
Cory Snider
b54af02b51
Merge pull request #44875 from corhere/libnet/local-scope-only
libnetwork: clean up vestigial datastore-related code
2023-01-27 13:26:44 -05:00
Tianon Gravi
6a69560847
Merge pull request #44837 from vvoland/c8d-fix-progress-notending-upstream
c8d/progress: Update progress when finished
2023-01-26 14:58:09 -08:00
Cory Snider
befff0e13f libnetwork: remove more datastore scope plumbing
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-26 17:56:40 -05:00
Cory Snider
cc19eba579 daemon: let libnetwork assign default bridge IPAM
The netutils.ElectInterfaceAddresses function is only used in one place
outside of tests: in the daemon, to configure the default bridge
network. The function is also messy to reason about as it references the
shared mutable state of ipamutils.PredefinedLocalScopeDefaultNetworks.
It uses the list of predefined default networks to always return an IPv4
address even if the named interface does not exist or does not have any
IPv4 addresses. This list happens to be the same as the one used to
initialize the address pool of the 'builtin' IPAM driver, though that is
far from obvious. (Start with "./libnetwork".initIPAMDrivers and trace
the dataflow of the addressPool value. Surprise! Global state is being
mutated using the value of other global mutable state.)

The daemon does not need the fallback behaviour of
ElectInterfaceAddresses. In fact, the daemon does not have to configure
an address pool for the network at all! libnetwork will acquire one of
the available address ranges from the network's IPAM driver when the
preferred-pool configuration is unset. It will do so using the same list
of address ranges and the exact same logic
(netutils.FindAvailableNetworks) as ElectInterfaceAddresses. So unless
the daemon needs to force the network to use a specific address range
because the bridge interface already exists, it can leave the details
up to libnetwork.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-26 14:54:57 -05:00
Paweł Gronowski
a654cbfd2f
Use GetBoolOrDefault to remove duplicated invalidFilter usages
The pattern of parsing bool was repeated across multiple files and
caused the duplication of the invalidFilter error helper.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-26 16:28:53 +01:00
Tianon Gravi
2b9de2e24a
Merge pull request #44809 from rumpl/containerd-image-history
daemon/c8d: Implement image history
2023-01-24 14:35:05 -08:00
Paweł Gronowski
1776f72c96
c8d/progress: Update progress when finished
After the context is cancelled, update the progress for the last time.
This makes sure that the progress also includes finishing updates.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-24 10:46:58 +01:00
Djordje Lukic
54f0b0ec4b c8d: Implement image history
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2023-01-23 16:50:02 +01:00
Bjorn Neergaard
65c371ed6e
Merge pull request #44842 from vvoland/c8d-fix-truncatedid
c8d: Fix resolving truncated id to a descriptor
2023-01-21 19:43:29 -07:00
Sebastiaan van Stijn
17b2c89116
Merge pull request #44818 from vvoland/c8d-commit-ctx-upstream
images: Pass context to commit related operations
2023-01-18 15:17:52 +01:00
Nicolas De Loof
9b5c21309b
images: Pass context to commit related operations
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-18 12:23:32 +01:00
Paweł Gronowski
596c8960b2
c8d: Fix resolving truncated id to a descriptor
Regular expression beginning anchor was placed after `sha256:` digest
prefix.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-18 12:10:07 +01:00
Cory Snider
c71555f030 libnetwork: return concrete-typed *Endpoint
libnetwork.Endpoint is an interface with a single implementation.

https://github.com/golang/go/wiki/CodeReviewComments#interfaces

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-13 14:19:06 -05:00
Cory Snider
0e91d2e0e9 libnetwork: return concrete-typed *Sandbox
Basically every exported method which takes a libnetwork.Sandbox
argument asserts that the value's concrete type is *sandbox. Passing any
other implementation of the interface is a runtime error! This interface
is a footgun, and clearly not necessary. Export and use the concrete
type instead.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-13 14:19:06 -05:00
Cory Snider
f96b9bf761 libnetwork: return concrete-typed *Controller
libnetwork.NetworkController is an interface with a single
implementation.

https://github.com/golang/go/wiki/CodeReviewComments#interfaces

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-13 14:09:37 -05:00
Bjorn Neergaard
868c897ad7
Merge pull request #44790 from neersighted/wide_json
daemon/config: support alternate (common) unicode encodings using a BOM
2023-01-12 13:15:58 -07:00
Bjorn Neergaard
4cd84c4b13
Merge pull request #44773 from neersighted/daemon_config_test
daemon/config: clean up tests to use common helper
2023-01-12 13:13:35 -07:00
Bjorn Neergaard
228f82fcda
Merge pull request #44628 from vvoland/c8d-import-upstream
daemon/c8d: Implement import
2023-01-12 09:35:43 -07:00
Bjorn Neergaard
4c02882f8a
Merge pull request #43225 from aivus/docker-in-overlayfs
Work around missing rename support when the backing filesystem is overlayfs
2023-01-11 17:54:32 -07:00
Bjorn Neergaard
6d212fa045
Merge pull request #44756 from rumpl/containerd-image-pull
containerd integration: image pull
2023-01-11 16:22:48 -07:00
Paweł Gronowski
9032e6779d c8d/resolver: Fallback to http for insecure registries
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-11 17:00:27 +01:00
Nicolas De Loof
c83fce86d4 c8d/resolver: Use hosts from daemon configuration
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-01-11 17:00:27 +01:00
Paweł Gronowski
3a3f98b32b c8d/pull: Don't unpack manually
We pass WithPullUnpack anyway

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-11 17:00:27 +01:00
Nicolas De Loof
4a8c4110e3 produce progress events polling ctrd's content.Store
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

containerd: Push progress

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-11 17:00:26 +01:00
Paweł Gronowski
d7deec1993
daemon/c8d: Implement import
If the imported layer archive is uncompressed, it gets compressed with
gzip before writing to the content store.
Archives compressed with gzip and zstd are imported as-is.
Xz and bzip2 are recompressed into gzip.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-11 13:53:44 +01:00
Paweł Gronowski
28327f10a2
daemon/import: Extract common logic to api
Extract logic that would need to be duplicated in both implementations
of ImageService.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-11 13:53:40 +01:00
Bjorn Neergaard
8dbc5df952
daemon/config: inform the user when the input JSON contains invalid UTF-8
This helps ensure that users are not surprised by unexpected tokens in
the JSON parser, or fallout later in the daemon.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-10 17:27:21 -07:00
Bjorn Neergaard
d42495033e
daemon/config: support alternate (common) unicode encodings using a BOM
This is a pragmatic but impure choice, in order to better support the
default tools available on Windows Server, and reduce user confusion due
to otherwise inscrutable-to-the-uninitiated errors like the following:

> invalid character 'þ' looking for beginning of value
> invalid character 'ÿ' looking for beginning of value

While meaningful to those who are familiar with and are equipped to
diagnose encoding issues, these characters will be hidden when the file
is edited with a BOM-aware text editor, and further confuse the user.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-10 15:49:15 -07:00
Bjorn Neergaard
1dcf7d5b03
daemon/config: clean up tests to use common helper
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-10 13:54:17 -07:00
Cory Snider
62296f9281
Merge pull request #44087 from jchorl/josh/sdkupgrade
Upgrade to aws go sdk v2 for cloudwatch logging driver
2023-01-10 14:51:30 -05:00
Bjorn Neergaard
62227e1bba
Merge pull request #44733 from jg-public/fix-rootless-specspaths--T43111
Use user data path for plugin discovery in rootless mode
2023-01-09 17:32:11 -07:00
Bjorn Neergaard
1ef0a1b1be
Merge pull request #44762 from AkihiroSuda/fix-btrfs-kernel-requirement
graphdriver/btrfs: needs kernel headers >= 4.12, not >= 4.7
2023-01-09 16:56:32 -07:00
Bjorn Neergaard
5db247da9d
Merge pull request #44770 from neersighted/ignore_bom
daemon/config: ignore UTF-8 BOM in config JSON
2023-01-09 16:41:57 -07:00
Tianon Gravi
a558074474
Merge pull request #43248 from thaJeztah/cleanup_translateContainerdStartErr
daemon: refactor translateContainerdStartErr() and remove unused argument
2023-01-09 13:23:19 -08:00