summaryrefslogtreecommitdiff
path: root/daemon/graphdriver/windows
Commit message (Collapse)AuthorAgeFilesLines
* daemon/graphdriver/windows: cleanup errorsSebastiaan van Stijn2023-03-141-9/+9
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* daemon/graphdriver/windows: remove some intermediate variablesSebastiaan van Stijn2023-03-141-14/+6
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* daemon/graphdriver/windows: use strings.EqualFold()Sebastiaan van Stijn2023-03-141-6/+5
| | | | | | | | | | | 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>
* daemon/graphdriver/windows: remove fileFlagSequentialScan constSebastiaan van Stijn2023-03-141-2/+1
| | | | | | Replace it with the const that's now defined in golang.org/x/sys/windows Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* daemon/graphdriver/windows: rename vars that collided with importsSebastiaan van Stijn2023-03-141-9/+9
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* daemon/graphdriver/windows: InitFilter() don't use idtools.MkdirAllAndChown()Sebastiaan van Stijn2023-03-141-1/+4
| | | | | | | | | | | 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>
* graphdriver: windows: use strings.Cut()Sebastiaan van Stijn2022-12-211-7/+8
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Merge pull request #44281 from thaJeztah/windows_filter_defer_in_loopTianon Gravi2022-10-141-1/+1
|\ | | | | daemon/graphdriver/windows: Remove() don't use defer() in a loop
| * daemon/graphdriver/windows: Remove() don't use defer() in a loopSebastiaan van Stijn2022-10-101-1/+1
| | | | | | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | daemon/graphdriver/windows: use go-winio.GetFileSystemType()Sebastiaan van Stijn2022-10-101-34/+2
|/ | | | | | | | | | | | | | | go-winio now defines this function, so we can consume that. Note that there's a difference between the old implementation and the original one (added in 1cb9e9b44e7140d14dd42d48b2a7c038b65e8f16). The old implementation had special handling for win32 error codes, which was removed in the go-winio implementation in https://github.com/microsoft/go-winio/commit/0966e1ad56670b39a6b55dfc2ad744c63cd1eb00 As `go-winio.GetFileSystemType()` calls `filepath.VolumeName(path)` internally, this patch also removes the `string(home[0])`, which is redundant, and could potentially panic if an empty string would be passed. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* pkg/containerfs: drop ContainerFS type aliasCory Snider2022-09-231-2/+1
| | | | Signed-off-by: Cory Snider <csnider@mirantis.com>
* pkg/containerfs: alias ContainerFS to stringCory Snider2022-09-231-3/+3
| | | | | | Drop the constructor and redundant string() type-casts. Signed-off-by: Cory Snider <csnider@mirantis.com>
* pkg/containerfs: simplify ContainerFS typeCory Snider2022-09-231-6/+6
| | | | | | Iterate towards dropping the type entirely. Signed-off-by: Cory Snider <csnider@mirantis.com>
* Finish refactor of UID/GID usage to a new structCory Snider2022-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | Finish the refactor which was partially completed with commit 34536c498d56, passing around IdentityMapping structs instead of pairs of []IDMap slices. Existing code which uses []IDMap relies on zero-valued fields to be valid, empty mappings. So in order to successfully finish the refactoring without introducing bugs, their replacement therefore also needs to have a useful zero value which represents an empty mapping. Change IdentityMapping to be a pass-by-value type so that there are no nil pointers to worry about. The functionality provided by the deprecated NewIDMappingsFromMaps function is required by unit tests to to construct arbitrary IdentityMapping values. And the daemon will always need to access the mappings to pass them to the Linux kernel. Accommodate these use cases by exporting the struct fields instead. BuildKit currently depends on the UIDs and GIDs methods so we cannot get rid of them yet. Signed-off-by: Cory Snider <csnider@mirantis.com>
* refactor: move from io/ioutil to io and os packageEng Zer Jun2021-08-271-6/+5
| | | | | | | | The io/ioutil package has been deprecated in Go 1.16. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* Update to Go 1.17.0, and gofmt with Go 1.17Sebastiaan van Stijn2021-08-241-1/+2
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Add security privilege needed to write layers when windows VHDX used as ↵Adam Williams2021-04-291-2/+2
| | | | | | docker data root Signed-off-by: Adam Williams <awilliams@mirantis.com>
* Parse storage-opt in GraphDriver init on WindowsPaul "TBBle" Hampson2020-11-101-7/+13
| | | | | | | | | This ensures the storage-opts applies to all operations by the graph drivers, replacing the merging of storage-opts into container storage config at container-creation time, and hence applying storage-opts to non-container operations like `COPY` and `ADD` in the builder. Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
* Apply a 127GB default WCOW Sandbox size globallyPaul "TBBle" Hampson2020-11-101-9/+30
| | | | | | | | | | | | | This applies the 127GB default WCOW Sandbox size to not just `RUN` under `docker build` (as was previously the case) but to `COPY` and `ADD` under `docker build` and also to `docker run`. It also removes an inconsistency that the 127GB size was not applied when `--platform windows` was not passed to `docker build`, but WCOW was still used as a platform default, e.g. Docker Desktop for Windows in Windows Containers mode. Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
* Revendor Microsoft/go-winio for 8gB file fixPaul "TBBle" Hampson2020-09-191-1/+1
| | | | | | | | | | | | This pulls in the migration of go-winio/backuptar from the bundled fork of archive/tar from Go 1.6 to using Go's current archive/tar unmodified. This fixes the failure to import an OCI layer (tar stream) containing a file larger than 8gB. Fixes: #40444 Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
* Use hcsshim osversion package for Windows versionsSebastiaan van Stijn2019-10-221-4/+5
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Remove refs to jhowardmsft from .go codeJohn Howard2019-09-251-1/+1
| | | | Signed-off-by: John Howard <jhoward@microsoft.com>
* goimports: fix importsSebastiaan van Stijn2019-09-181-1/+1
| | | | | | | Format the source according to latest goimports. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Windows: Don't attempt detach VHD for R/O layersJohn Howard2019-06-041-5/+8
| | | | Signed-off-by: John Howard <jhoward@microsoft.com>
* Remove duplicated words in daemon filesmooncake2018-10-061-1/+1
| | | | Signed-off-by: mooncake <xcoder@tenxcloud.com>
* Windows: DetachVhd attempt in cleanupJohn Howard2018-09-061-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: John Howard <jhoward@microsoft.com> This is a fix for a few related scenarios where it's impossible to remove layers or containers until the host is rebooted. Generally (or at least easiest to repro) through a forced daemon kill while a container is running. Possibly slightly worse than that, as following a host reboot, the scratch layer would possibly be leaked and left on disk under the dataroot\windowsfilter directory after the container is removed. One such example of a failure: 1. run a long running container with the --rm flag docker run --rm -d --name test microsoft/windowsservercore powershell sleep 30 2. Force kill the daemon not allowing it to cleanup. Simulates a crash or a host power-cycle. 3. (re-)Start daemon 4. docker ps -a PS C:\control> docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7aff773d782b malloc "powershell start-sl…" 11 seconds ago Removal In Progress malloc 5. Try to remove PS C:\control> docker rm 7aff Error response from daemon: container 7aff773d782bbf35d95095369ffcb170b7b8f0e6f8f65d5aff42abf61234855d: driver "windowsfilter" failed to remove root filesystem: rename C:\control\windowsfilter\7aff773d782bbf35d95095369ffcb170b7b8f0e6f8f65d5aff42abf61234855d C:\control\windowsfilter\7aff773d782bbf35d95095369ffcb170b7b8f0e6f8f65d5aff42abf61234855d-removing: Access is denied. PS C:\control> Step 5 fails.
* Add ADD/COPY --chown flag support to WindowsSalahuddin Khan2018-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | This implements chown support on Windows. Built-in accounts as well as accounts included in the SAM database of the container are supported. NOTE: IDPair is now named Identity and IDMappings is now named IdentityMapping. The following are valid examples: ADD --chown=Guest . <some directory> COPY --chown=Administrator . <some directory> COPY --chown=Guests . <some directory> COPY --chown=ContainerUser . <some directory> On Windows an owner is only granted the permission to read the security descriptor and read/write the discretionary access control list. This fix also grants read/write and execute permissions to the owner. Signed-off-by: Salahuddin Khan <salah@docker.com>
* Merge pull request #36738 from Microsoft/jjh/getlayerpathYong Tang2018-04-141-0/+5
|\ | | | | Windows: Add GetLayerPath implementation in graphdriver
| * Windows: GetLayerPath in graphdriverJohn Howard (VM)2018-03-291-0/+5
| | | | | | | | Signed-off-by: John Howard (VM) <jhoward@ntdev.microsoft.com>
* | Fix Windows layer leak when write failsDarren Stahl2018-04-041-11/+11
|/ | | | Signed-off-by: Darren Stahl <darst@microsoft.com>
* Add canonical import commentDaniel Nephin2018-02-051-1/+1
| | | | Signed-off-by: Daniel Nephin <dnephin@docker.com>
* LCOW: Refactor to multiple layer-stores based on feedbackJohn Howard2018-01-181-2/+0
| | | | Signed-off-by: John Howard <jhoward@microsoft.com>
* Remove deprecated MkdirAllAs(), MkdirAs()Sebastiaan van Stijn2017-11-211-1/+1
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* LCOW: API: Add platform to /images/create and /buildJohn Howard2017-10-061-22/+0
| | | | | | | | | | | | | | | Signed-off-by: John Howard <jhoward@microsoft.com> This PR has the API changes described in https://github.com/moby/moby/issues/34617. Specifically, it adds an HTTP header "X-Requested-Platform" which is a JSON-encoded OCI Image-spec `Platform` structure. In addition, it renames (almost all) uses of a string variable platform (and associated) methods/functions to os. This makes it much clearer to disambiguate with the swarm "platform" which is really os/arch. This is a stepping stone to getting the daemon towards fully multi-platform/arch-aware, and makes it clear when "operating system" is being referred to rather than "platform" which is misleadingly used - sometimes in the swarm meaning, but more often as just the operating system.
* LCOW: Implemented support for docker cp + buildAkash Gupta2017-09-141-9/+10
| | | | | | | | | | This enables docker cp and ADD/COPY docker build support for LCOW. Originally, the graphdriver.Get() interface returned a local path to the container root filesystem. This does not work for LCOW, so the Get() method now returns an interface that LCOW implements to support copying to and from the container. Signed-off-by: Akash Gupta <akagup@microsoft.com>
* Update logrus to v1.0.1Derek McGowan2017-07-311-1/+1
| | | | | | Fixes case sensitivity issue Signed-off-by: Derek McGowan <derek@mcgstyle.net>
* [project] change syscall to /x/sys/unix|windowsChristopher Jones2017-07-111-5/+5
| | | | | | | | | | | | | | | | Changes most references of syscall to golang.org/x/sys/ Ones aren't changes include, Errno, Signal and SysProcAttr as they haven't been implemented in /x/sys/. Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com> [s390x] switch utsname from unsigned to signed per https://github.com/golang/sys/commit/33267e036fd93fcd26ea95b7bdaf2d8306cb743c char in s390x in the /x/sys/unix package is now signed, so change the buildtags Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
* Spelling fixesJosh Soref2017-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * additional * ambiguous * anonymous * anything * application * because * before * building * capabilities * circumstances * commit * committer * compresses * concatenated * config * container * container's * current * definition * delimiter * disassociates * discovery * distributed * doesnotexist * downloads * duplicates * either * enhancing * enumerate * escapable * exactly * expect * expectations * expected * explicitly * false * filesystem * following * forbidden * git with * healthcheck * ignore * independent * inheritance * investigating * irrelevant * it * logging * looking * membership * mimic * minimum * modify * mountpoint * multiline * notifier * outputting * outside * overridden * override * parsable * plugins * precedence * propagation * provided * provides * registries * repositories * returning * settings * should * signals * someone * something * specifically * successfully * synchronize * they've * thinking * uninitialized * unintentionally * unmarshaling * unnamed * unreferenced * verify Signed-off-by: Josh Soref <jsoref@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* LCOW: Fix nits from 33241John Howard2017-06-271-1/+1
| | | | Signed-off-by: John Howard <jhoward@microsoft.com>
* LCOW: Coherency - ensure windowsfilter driver is not usedJohn Howard2017-06-201-1/+22
| | | | Signed-off-by: John Howard <jhoward@microsoft.com>
* LCOW: Move daemon stores to per platformJohn Howard2017-06-201-0/+4
| | | | Signed-off-by: John Howard <jhoward@microsoft.com>
* Windows: Do not attempt to clean empty windowsfilter folderDarren Stahl2017-04-171-0/+3
| | | | Signed-off-by: Darren Stahl <darst@microsoft.com>
* Merge pull request #31954 from darrenstahlmsft/GraphdriverReferenceVictor Vieux2017-04-101-0/+9
|\ | | | | Windows: Fix reference counting in graphdriver
| * Windows: Fix reference counting in graphdriverDarren Stahl2017-04-101-0/+9
| | | | | | | | Signed-off-by: Darren Stahl <darst@microsoft.com>
* | Windows: graph cleanup '-removing'John Howard (VM)2017-03-201-0/+22
|/ | | | Signed-off-by: John Howard (VM) <jhoward@ntdev.microsoft.com>
* Windows: Retry loop to fix HCS race condition enumerating containersJohn Howard2017-02-151-7/+24
| | | | | | | | | Signed-off-by: John Howard <jhoward@microsoft.com> This fixes https://github.com/docker/docker/issues/30278 where there is a race condition in HCS for RS1 and RS2 builds, and enumeration of compute systems can return access is denied if a silo is being torn down in the kernel while HCS is attempting to enumerate them.
* Windows: Use sequential file accessJohn Howard2017-01-231-2/+4
| | | | Signed-off-by: John Howard <jhoward@microsoft.com>
* daemon: return directly without ifs where possibleunclejack2016-12-141-5/+1
| | | | Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
* Swap usage of LazyDLL and LoadDLL to LazySystemDLL.Darren Stahl2016-11-221-2/+3
| | | | Signed-off-by: Darren Stahl <darst@microsoft.com>
* fix a few golint errorsVictor Vieux2016-11-181-4/+2
| | | | Signed-off-by: Victor Vieux <victorvieux@gmail.com>