Commit graph

7583 commits

Author SHA1 Message Date
Sebastiaan van Stijn
66137ae429
containerd: set user-agent when pushing/pulling images
Before this, the client would report itself as containerd, and the containerd
version from the containerd go module:

    time="2023-06-01T09:43:21.907359755Z" level=info msg="listening on [::]:5000" go.version=go1.19.9 instance.id=67b89d83-eac0-4f85-b36b-b1b18e80bde1 service=registry version=2.8.2
    ...
    172.18.0.1 - - [01/Jun/2023:09:43:33 +0000] "HEAD /v2/multifoo/blobs/sha256:cb269d7c0c1ca22fb5a70342c3ed2196c57a825f94b3f0e5ce3aa8c55baee829 HTTP/1.1" 404 157 "" "containerd/1.6.21+unknown"

With this patch, the user-agent has the docker daemon information;

    time="2023-06-01T11:27:07.959822887Z" level=info msg="listening on [::]:5000" go.version=go1.19.9 instance.id=53590f34-096a-4fd1-9c58-d3b8eb7e5092 service=registry version=2.8.2
    ...
    172.18.0.1 - - [01/Jun/2023:11:27:20 +0000] "HEAD /v2/multifoo/blobs/sha256:c7ec7661263e5e597156f2281d97b160b91af56fa1fd2cc045061c7adac4babd HTTP/1.1" 404 157 "" "docker/dev go/go1.20.4 git-commit/8d67d0c1a8 kernel/5.15.49-linuxkit-pr os/linux arch/arm64 UpstreamClient(Docker-Client/24.0.2 \\(linux\\))"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-01 14:20:45 +02:00
Sebastiaan van Stijn
8d67d0c1a8
Merge pull request #45437 from thaJeztah/vendor_image_spec
vendor: github.com/opencontainers/image-spec v1.1.0-rc3
2023-05-31 11:12:51 +02:00
Bjorn Neergaard
988f5ac342
Merge pull request #45647 from rumpl/fix-snapshotter-change
c8d: Fix re-pull of an image when the snapshotter is changed
2023-05-30 15:32:55 -06:00
Djordje Lukic
ed32f5e241 Make sure the image is unpacked for the current snapshotter
Switching snapshotter implementations would result in an error when
preparing a snapshot, check that the image is indeed unpacked for the
current snapshot before trying to prepare a snapshot.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2023-05-30 14:45:30 +02:00
Brian Goff
487ea81316 Fix npe in exec resize when exec errored
In cases where an exec start failed the exec process will be nil even
though the channel to signal that the exec started was closed.

Ideally ExecConfig would get a nice refactor to handle this case better
(ie. it's not started so don't close that channel).
This is a minimal fix to prevent NPE. Luckilly this would only get
called by a client and only the http request goroutine gets the panic
(http lib recovers the panic).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-05-28 00:14:47 +00:00
Sebastiaan van Stijn
b42e367045
vendor: github.com/opencontainers/image-spec v1.1.0-rc3
full diff: https://github.com/opencontainers/image-spec/compare/3a7f492d3f1b...v1.1.0-rc3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-26 02:34:50 +02:00
Akihiro Suda
5045a2de24
Support recursively read-only (RRO) mounts
`docker run -v /foo:/foo:ro` is now recursively read-only on kernel >= 5.12.

Automatically falls back to the legacy non-recursively read-only mount mode on kernel < 5.12.

Use `ro-non-recursive` to disable RRO.
Use `ro-force-recursive` or `rro` to explicitly enable RRO. (Fails on kernel < 5.12)

Fix issue 44978
Fix docker/for-linux issue 788

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-05-26 01:58:24 +09:00
Cory Snider
1b28b0ed5a
Merge pull request #45134 from elezar/add-cdi-support
Add support for CDI devices under Linux
2023-05-25 18:06:31 +02:00
Paweł Gronowski
b9b8b6597a
c8d/inspect: Fill Created time if available
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-05-25 14:59:49 +02:00
Sebastiaan van Stijn
f1d5385515
Merge pull request #45609 from thaJeztah/constantly_numb
c8d: ImageService.softImageDelete: use OCI and containerd constants
2023-05-25 09:52:31 +02:00
Sebastiaan van Stijn
f17c9e4aeb
c8d: ImageService.softImageDelete: rename var that collided with import
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-25 01:44:36 +02:00
Sebastiaan van Stijn
df5deab20b
c8d: ImageService.softImageDelete: use OCI and containerd constants
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-25 01:44:31 +02:00
Cory Snider
9b9c5242eb daemon: lock in snapshotter setting at daemon init
Feature flags are one of the configuration items which can be reloaded
without restarting the daemon. Whether the daemon uses the containerd
snapshotter service or the legacy graph drivers is controlled by a
feature flag. However, much of the code which checks the snapshotter
feature flag assumes that the flag cannot change at runtime. Make it so
that the snapshotter setting can only be changed by restarting the
daemon, even if the flag state changes after a live configuration
reload.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-05-24 16:56:17 -04:00
Sebastiaan van Stijn
c5126d1435
Merge pull request #45601 from vvoland/c8d-exists
c8d/pull: Use same progress action as distribution
2023-05-24 12:48:12 +02:00
Paweł Gronowski
a7bc65fbd8
c8d/pull: Use same progress action as distribution
Docker with containerd integration emits "Exists" progress action when a
layer of the currently pulled image already exists. This is different
from the non-c8d Docker which emits "Already exists".

This makes both implementations consistent by emitting backwards
compatible "Already exists" action.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-05-24 11:16:57 +02:00
Sebastiaan van Stijn
86108812b8
vendor: github.com/mistifyio/go-zfs/v3 v3.0.1
Switching to the v3 version, which was renamed to be compatible with
go modules.

Full diff: https://github.com/mistifyio/go-zfs/compare/f784269be439...v3.0.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-23 12:52:16 +02:00
Sebastiaan van Stijn
7796891381
Merge pull request #45475 from thaJeztah/remove_old_buildtags 2023-05-20 02:10:19 +02:00
Sebastiaan van Stijn
411a9e1b86
daemon: remove devicemapper driver-warnings
commit dc11d2a2d8 removed the devicemapper
storage-driver, so these warnings are no longer relevant.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-19 20:45:31 +02:00
Sebastiaan van Stijn
424a1c5d21
daemon: remove warning for overlay/overlay2 without d_type
commit 0abb8dec3f removed support for
running overlay/overlay2 on top of a backing filesystem without d_type
support, and  turned it into a fatal error when starting the daemon,
so there's no need to generate warnings for this situation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-19 20:43:51 +02:00
Sebastiaan van Stijn
ab35df454d
remove pre-go1.17 build-tags
Removed pre-go1.17 build-tags with go fix;

    go mod init
    go fix -mod=readonly ./...
    rm go.mod

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-19 20:38:51 +02:00
Paweł Gronowski
34964c2454
c8d/list: Show layerless images
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-05-19 18:12:14 +02:00
Cory Snider
61757032da d/graphdriver/vfs: fix unit test
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-05-19 08:26:15 -04:00
Cory Snider
6690d2969c pkg/archive: bail if setting xattrs is unsupported
Extended attributes are set on files in container images for a reason.
Fail to unpack if extended attributes are present in a layer and setting
the attributes on the unpacked files fails for any reason.

Add an option to the vfs graph driver to opt into the old behaviour
where ENOTSUPP and EPERM errors encountered when setting extended
attributes are ignored. Make it abundantly clear to users and anyone
triaging their bug reports that they are shooting themselves in the
foot by enabling this option.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-05-18 17:21:12 -04:00
Bjorn Neergaard
ccd834ea25
Merge pull request #45557 from crazy-max/fix-worker-id
build: use daemon id as worker id for the graph driver controller
2023-05-18 21:17:43 +01:00
Sebastiaan van Stijn
50d2c94bd6
Merge pull request #43637 from thaJeztah/remove_deprecated_storage_drivers
Remove deprecated devicemapper storage driver
2023-05-18 21:23:41 +02:00
Kevin Alvarez
6d139e5e95
build: use daemon id as worker id for the graph driver controller
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-05-18 21:17:29 +02:00
Sebastiaan van Stijn
054add40a1
Merge pull request #45552 from miles-to-go/fix-insecure-registries-reload
Fix insecure registries reload
2023-05-18 20:56:55 +02:00
Laura Brehm
f450ea64e6
fix: docker pull with platform checks wrong image tag
This fixes a bug where, if a user pulls an image with a tag != `latest` and
a specific platform, we return an NotFound error for the wrong (`latest`) tag.
see: https://github.com/moby/moby/issues/45558

This bug was introduced in 779a5b3029
in the changes to `daemon/images/image_pull.go`, when we started returning the error from the call to
`GetImage` after the pull. We do this call, if pulling with a specified platform, to check if the platform
of the pulled image matches the requested platform (for cases with single-arch images).
However, when we call `GetImage` we're not passing the image tag, only name, so `GetImage` assumes `latest`
which breaks when the user has requested a different tag, since there might not be such an image in the store.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-05-18 13:14:59 +01:00
Nolan Miles
f3645a2aa3 reorder load funcs to match newServiceConfig()'s order
Signed-off-by: Nolan Miles <nolanpmiles@gmail.com>
2023-05-17 21:34:14 -04:00
Nolan Miles
3b15156e4d add mirror to daemon reload test for insecure registries
Signed-off-by: Nolan Miles <nolanpmiles@gmail.com>
2023-05-17 21:34:14 -04:00
Evan Lezar
dedf5747cc Remove need to set Capabilities for cdi driver
Signed-off-by: Evan Lezar <elezar@nvidia.com>
2023-05-16 17:07:58 +02:00
Evan Lezar
7ec9561a77 Add support for CDI devices to docker daemon under linux
These changes add basic CDI integration to the docker daemon.

A cdi driver is added to handle cdi device requests. This
is gated by an experimental feature flag and is only supported on linux

This change also adds a CDISpecDirs (cdi-spec-dirs) option to the config.
This allows the default values of `/etc/cdi`, /var/run/cdi` to be overridden
which is useful for testing.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
2023-05-16 17:07:57 +02:00
Evan Lezar
5a200ade7c Rename daemon/devices_liunx.go to daemom/devices.go
Signed-off-by: Evan Lezar <elezar@nvidia.com>
2023-05-16 17:07:57 +02:00
Akihiro Suda
1371aee3cc
Merge pull request #45469 from thaJeztah/deprecate_virtualsize_STEP2
API: omit deprecated VirtualSize field for API v1.44 and up
2023-05-16 15:10:07 +09:00
Sebastiaan van Stijn
bafcfdf8c5
Merge pull request #45484 from thaJeztah/remove_deprecated_stubs
remove deprecated types, fields, and functions
2023-05-12 14:03:26 +01:00
Djordje Lukic
348a79958d
c8d: The authorizer needs to be set even if AuthConfig is empty
Without the authorizer pulling will fail if the user is not logged-in

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2023-05-12 09:41:34 +02:00
Tianon Gravi
46ce4ec8cf
Merge pull request #45322 from laurazard/c8d-upstream-classic-builder
c8d: implement classic builder
2023-05-11 18:10:21 +00:00
Paweł Gronowski
3309e45ca1
c8d: Don't create authorizer for empty AuthConfig
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-05-11 14:32:46 +02:00
Paweł Gronowski
2ad499f93e
c8d/authorizer: Default to docker.io
When the `ServerAddress` in the `AuthConfig` provided by the client is
empty, default to the default registry (registry-1.docker.io).

This makes the behaviour the same as with the containerd image store
integration disabled.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-05-11 14:17:57 +02:00
Laura Brehm
bd6868557d
c8d/builder: implement cache
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-05-11 12:02:09 +01:00
Laura Brehm
e46674b6a7
c8d: implement classic builder
Co-authored-by: Djordje Lukic <djordje.lukic@docker.com>
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-05-11 11:57:01 +01:00
Sebastiaan van Stijn
3b443c8cfc
Merge pull request #45508 from laurazard/c8d-dangling-image-history
c8d: image history – handle dangling images
2023-05-10 22:30:02 +02:00
Sebastiaan van Stijn
f70d9933d1
Merge pull request #45427 from laurazard/c8d-fix-incomplete-images
c8d: implement missing image delete logic
2023-05-10 18:01:45 +02:00
Sebastiaan van Stijn
3f7fde76c2
Merge pull request #45507 from corhere/cleanup-reexec-inits
[chore] clean up reexec.Init() calls
2023-05-10 11:49:11 +02:00
Laura Brehm
4603b6d6b6
c8d: fix image history for dangling images
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-05-10 01:33:15 +01:00
Brian Goff
03885e1b00
Merge pull request #45490 from Jeyanthinath/consistent_alias
fixing consistent aliases for OCI spec imports
2023-05-09 16:33:32 -07:00
Cory Snider
4e0319c878 [chore] clean up reexec.Init() calls
Now that most uses of reexec have been replaced with non-reexec
solutions, most of the reexec.Init() calls peppered throughout the test
suites are unnecessary. Furthermore, most of the reexec.Init() calls in
test code neglects to check the return value to determine whether to
exit, which would result in the reexec'ed subprocesses proceeding to run
the tests, which would reexec another subprocess which would proceed to
run the tests, recursively. (That would explain why every reexec
callback used to unconditionally call os.Exit() instead of returning...)

Remove unneeded reexec.Init() calls from test and example code which no
longer needs it, and fix the reexec.Init() calls which are not inert to
exit after a reexec callback is invoked.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-05-09 19:13:17 -04:00
Sebastiaan van Stijn
b07d2a3827
Merge pull request #45486 from thaJeztah/daemon_monitor_logclean
daemon: handleContainerExit(): use logrus.WithFields
2023-05-10 00:51:50 +02:00
Sebastiaan van Stijn
b587c5a2f8
Merge pull request #45501 from laurazard/c8d-image-history
c8d: add image history
2023-05-09 18:46:44 +02:00
Laura Brehm
e8be792130
c8d: fix missing image history
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-05-09 16:19:05 +01:00