Add support for storage-opt size with the windows snapshotter #6
+93
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- What I did
Forward the --storage-opt size parameter to the windows snapshotter
This is primarily motivated by the desire to create windows containers with the io.containerd.snapshotter.v1 storage driver with a rootfs size larger than the default quota of 20G.
- How I did it
In the containerd ImageService, we convert StorageOpt to an array of snaphots.Opt. Currently only the windows snappshotter has a well defined interface for quotas, the
containerd.io/snapshot/windows/rootfs.sizebyteslabel. For other drivers, we issue warning and keep the existing behavior of doing nothing.- How to verify it
Requires a windows dockerd+containerd using the containerd snapshotter
daemon.json{ "experimental": true, "features": { "containerd-snapshotter": true }, "containerd": "\\\\.\\pipe\\containerd-containerd", "containerd-namespace": "default", "hosts": [ "npipe:////./pipe/docker_engine" ] }Integration Test
Manual
For the two cases below the commands run are:
docker run --rm -it mcr.microsoft.com/windows/servercore:ltsc2022 powershell -Command "(gdr C).Free + (gdr C).Used"docker run --storage-opt size=64G --rm -it mcr.microsoft.com/windows/servercore:ltsc2022 powershell -Command "(gdr C).Free + (gdr C).Used"Before this change:
Output from 1:
21339549696Output from 2:
21339549696After this change:
Output from 1:
21340233728Output from 2:
68584185856- Human readable description for the release notes
Add support for
--storage-opt size=Nargument when using the windows io.containerd.snapshotter.v1 storage driver- A picture of a cute animal (not mandatory but encouraged)