Skip to content

Conversation

@mendsley
Copy link
Member

@mendsley mendsley commented Apr 30, 2025

- 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.sizebytes label. 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

> cd integration\container
> gotestsum.exe -- -run '^TestContainerdSnapshotQuota$' -v

✓  github.com/docker/docker/integration/container (3.239s)

DONE 1 tests in 4.667s

Manual

For the two cases below the commands run are:

  1. docker run --rm -it mcr.microsoft.com/windows/servercore:ltsc2022 powershell -Command "(gdr C).Free + (gdr C).Used"
  2. 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: 21339549696
Output from 2: 21339549696

After this change:

Output from 1: 21340233728
Output from 2: 68584185856

- Human readable description for the release notes
Add support for --storage-opt size=N argument when using the windows io.containerd.snapshotter.v1 storage driver

- A picture of a cute animal (not mandatory but encouraged)

@mendsley mendsley force-pushed the mendsley/win_snapshotter_size branch 7 times, most recently from 7a54788 to a04cca6 Compare April 30, 2025 23:46
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.

Signed-off-by: Matthew Endsley <mendsley@gmail.com>
@mendsley mendsley force-pushed the mendsley/win_snapshotter_size branch from a04cca6 to 9e031a2 Compare May 1, 2025 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants