Docker - the open-source application container engine
Перейти к файлу
John Howard af0f7dec7b Windows: Case (in-)sensitivity for volume parser
Signed-off-by: John Howard <jhoward@microsoft.com>

Fixes https://github.com/moby/moby/issues/36613. This was kind of interesting, as removing the case-insensitivity (I think I just put it there some 3 or more years ago to make life easier and long since forgot about it as Windows at this level is generally case insensitive and way before I had thought about LCOW) found another 'bug' (I say bug, but the code was doing the right thing, just for the wrong reason) which looks to have been introduced part by me, and part by refactoring of this code a year or more back. Case caught by the unit tests.

That bug was that the reserved name check has nothing whatsoever to do with the fix for 26329, but that's where it was in the code. Was very confused trying to figure out what its purpose was in that 26329-fix block, or which it was checking destination rather than source. Anyway, moved it to the right place and all is well.

After this, you can now do something such as the following - note the target directory inside the container as the important bit - the host casing is irrelevant as Windows here is case-insensitive. Similarly in the Windows case, the target casing is irrelevant.

LCOW:
```
PS E:\> docker run --rm -v c:\CaSeOnHoSt:/bar/humbuG:rW alpine ls /bar
humbuG
PS E:\> docker run --rm -v c:\caseonhost:/bar/humbuG:rW alpine ls /bar
humbuG
PS E:\> docker run --rm -v C:\CaSeOnHoSt:/bar/humbug alpine ls /bar
humbug
PS E:\>
```

WCOW:
```
PS E:\> docker run --rm -v c:\CaSeOnHoSt:c:/bar/humbuG:rW microsoft/nanoserver cmd /s /c dir c:\bar
 Volume in drive C has no label.
 Volume Serial Number is 106A-BF5E

 Directory of c:\bar

09/25/2018  04:10 PM    <DIR>          .
09/25/2018  04:10 PM    <DIR>          ..
09/25/2018  04:08 PM    <DIR>          humbuG
               0 File(s)              0 bytes
               3 Dir(s)  21,299,740,672 bytes free
PS E:\> docker run --rm -v c:\caseonhost:c:/bar/humbuG:rW microsoft/nanoserver cmd /s /c dir c:\bar
 Volume in drive C has no label.
 Volume Serial Number is 106A-BF5E

 Directory of c:\bar

09/25/2018  04:11 PM    <DIR>          .
09/25/2018  04:11 PM    <DIR>          ..
09/25/2018  04:08 PM    <DIR>          humbuG
               0 File(s)              0 bytes
               3 Dir(s)  21,299,732,480 bytes free
PS E:\>
```

Note: You cannot, at least in RS5, unfortunately do the following after this fix - mapping two directories /a and /A in LCOW located in the same folder. Need to figure out where that is, but likely a platform issue at this point in HCS.  However, you couldn't do it before either haha.

```
docker run --rm -v c:\UPPER:/foo/A -v c:\lower:/foo/a alpine ls -l /foo
e:\go\src\github.com\docker\cli\binary\docker.exe: Error response from daemon: CreateComputeSystem b3ba52af987bff00224d5aebeb656172271c25acb9c0b54dcd1941cd765257c6: The object already exists.
(extra info: {"SystemType":"container","Name":"b3ba52af987bff00224d5aebeb656172271c25acb9c0b54dcd1941cd765257c6","Owner":"docker","LayerFolderPath":"C:\\control\\lcow\\b3ba52af987bff00224d5aebeb656172271c25acb9c0b54dcd1941cd765257c6","Layers":[{"ID":"2e2ab5f1-6ea9-557b-af6c-c401a2a3db37","Path":"C:\\control\\lcow\\fb27f0fc7fbad278718cab180f3e0dcc238fc8509560b5db3e79804b0de1ec4a\\layer.vhd"}],"MappedDirectories":[{"HostPath":"c:\\UPPER","ContainerPath":"/tmp/gcs/b3ba52af987bff00224d5aebeb656172271c25acb9c0b54dcd1941cd765257c6/binds/foo/A","ReadOnly":false,"BandwidthMaximum":0,"IOPSMaximum":0,"CreateInUtilityVM":true,"LinuxMetadata":true},{"HostPath":"c:\\lower","ContainerPath":"/tmp/gcs/b3ba52af987bff00224d5aebeb656172271c25acb9c0b54dcd1941cd765257c6/binds/foo/a","ReadOnly":false,"BandwidthMaximum":0,"IOPSMaximum":0,"CreateInUtilityVM":true,"LinuxMetadata":true}],"HvPartition":true,"EndpointList":["C54594FC-A983-4D70-9E37-DC73734C4885"],"HvRuntime":{"ImagePath":"C:\\Program Files\\Linux Containers","LinuxInitrdFile":"initrd.img","LinuxKernelFile":"kernel"},"AllowUnqualifiedDNSQuery":true,"ContainerType":"linux","TerminateOnLastHandleClosed":true}).
PS C:\>
```
2018-10-05 16:26:55 -07:00
.github Remove myself from CODEOWNERS 2018-03-26 13:45:05 -04:00
api Merge pull request #37741 from mooncak/fix_typos 2018-09-14 11:53:54 +02:00
builder Merge pull request #37846 from tiborvass/buildkit-gc 2018-09-22 10:00:06 -07:00
cli Various code-cleanup 2018-05-23 17:50:54 +02:00
client client: dial tls on Dialer if tls config is set 2018-09-04 17:43:33 -07:00
cmd/dockerd builder: use buildkit's GC for build cache 2018-09-21 22:06:00 +00:00
container Merge pull request #37092 from cpuguy83/local_logger 2018-08-20 07:01:41 +01:00
contrib Removed the "-i -t" arguments from the smoke test calling printf (these flags seem not really needed, and break jenkins builds with error "the input device is not a TTY") 2018-07-05 17:29:17 +02:00
daemon Merge pull request #37891 from mirake/fix-typos 2018-09-24 17:22:34 +02:00
distribution Include original error when translating distribution errors 2018-08-03 16:12:44 +02:00
dockerversion fix typo 2018-09-08 08:13:30 +08:00
docs Changes to cluster/filter, swagger.yaml, version-history.md for filtering on node labels. 2018-08-21 22:17:23 +02:00
errdefs Fix the several typos detected by github.com/client9/misspell 2018-08-09 00:45:00 +09:00
hack Vendor libnetwork @ 36d3bed0e9 2018-09-13 13:52:45 -07:00
image system: add back lcow validation function 2018-06-27 15:24:26 -07:00
integration Merge pull request #37851 from adshmh/migrate-ipc-integration-tests-to-integration-container 2018-09-22 09:58:56 -07:00
integration-cli Merge pull request #37851 from adshmh/migrate-ipc-integration-tests-to-integration-container 2018-09-22 09:58:56 -07:00
internal Merge pull request #37851 from adshmh/migrate-ipc-integration-tests-to-integration-container 2018-09-22 09:58:56 -07:00
layer Add ADD/COPY --chown flag support to Windows 2018-08-13 21:59:11 -07:00
libcontainerd Merge pull request #37759 from dmcgowan/fix-libcontainerd-startup-error 2018-09-14 15:15:38 +02:00
migrate/v1 Format code with gofmt -s from go-1.11beta1 2018-09-06 15:24:16 -07:00
oci Add /proc/acpi to masked paths 2018-07-05 17:39:52 +02:00
opts Format code with gofmt -s from go-1.11beta1 2018-09-06 15:24:16 -07:00
pkg Merge pull request #37780 from tiborvass/fix-progress-panic 2018-09-13 14:45:15 -07:00
plugin Merge pull request #35521 from salah-khan/35507 2018-08-17 11:31:16 -07:00
profiles Whitelist syscalls linked to CAP_SYS_NICE in default seccomp profile 2018-06-20 07:32:08 -05:00
project Remove references to old release process 2018-05-18 18:28:43 +00:00
reference Format code with gofmt -s from go-1.11beta1 2018-09-06 15:24:16 -07:00
registry Format code with gofmt -s from go-1.11beta1 2018-09-06 15:24:16 -07:00
reports Fix typos 2018-05-16 09:15:43 +08:00
restartmanager Add canonical import comment 2018-02-05 16:51:57 -05:00
runconfig Format code with gofmt -s from go-1.11beta1 2018-09-06 15:24:16 -07:00
vendor vendor: update swarmkit to 9f271c2 and remove boltdb 2018-09-24 17:36:07 +00:00
volume Windows: Case (in-)sensitivity for volume parser 2018-10-05 16:26:55 -07:00
.DEREK.yml project: try alexellis/derek bot to manage PRs and issues 2017-12-04 16:11:41 +01:00
.dockerignore [EXPERIMENTAL] Integration Test on Swarm 2017-02-28 02:10:09 +00:00
.gitignore Add code coverage report and codecov config 2018-01-16 16:50:56 -05:00
.mailmap Update authors and mailmap 2018-09-07 23:43:34 +08:00
AUTHORS Update authors and mailmap 2018-09-07 23:43:34 +08:00
CHANGELOG.md Fix some typos 2018-09-07 13:13:47 +08:00
CONTRIBUTING.md Fix link anchors in CONTRIBUTING.md 2018-06-13 21:58:48 +09:00
Dockerfile Bump golang to 1.11.0 2018-09-06 15:24:44 -07:00
Dockerfile.e2e Bump golang to 1.11.0 2018-09-06 15:24:44 -07:00
Dockerfile.simple Bump golang to 1.11.0 2018-09-06 15:24:44 -07:00
Dockerfile.windows Bump golang to 1.11.0 2018-09-06 15:24:44 -07:00
LICENSE Update LICENSE 2018-09-12 14:27:53 +01:00
MAINTAINERS Fix the several typos detected by github.com/client9/misspell 2018-08-09 00:45:00 +09:00
Makefile Expose license status in Info (#37612) 2018-08-17 17:05:21 -07:00
NOTICE Update LICENSE date 2017-02-15 17:34:33 +01:00
README.md Add "Lego set" back in README.md 2017-10-10 14:10:39 +00:00
ROADMAP.md Update the Roadmap 2017-10-11 17:33:50 +01:00
TESTING.md Merge pull request #37249 from AntaresS/add-test-guidline 2018-06-25 20:44:42 +02:00
VENDORING.md fix the bare url and the Summary of http://semver.org 2017-01-17 16:20:11 +08:00
codecov.yml Add code coverage report and codecov config 2018-01-16 16:50:56 -05:00
poule.yml Add myself to poule to get 2w/old PRs 2018-04-16 18:33:21 +02:00
vendor.conf vendor: update swarmkit to 9f271c2 and remove boltdb 2018-09-24 17:36:07 +00:00

README.md

The Moby Project

Moby Project logo

Moby is an open-source project created by Docker to enable and accelerate software containerization.

It provides a "Lego set" of toolkit components, the framework for assembling them into custom container-based systems, and a place for all container enthusiasts and professionals to experiment and exchange ideas. Components include container build tools, a container registry, orchestration tools, a runtime and more, and these can be used as building blocks in conjunction with other tools and projects.

Principles

Moby is an open project guided by strong principles, aiming to be modular, flexible and without too strong an opinion on user experience. It is open to the community to help set its direction.

  • Modular: the project includes lots of components that have well-defined functions and APIs that work together.
  • Batteries included but swappable: Moby includes enough components to build fully featured container system, but its modular architecture ensures that most of the components can be swapped by different implementations.
  • Usable security: Moby provides secure defaults without compromising usability.
  • Developer focused: The APIs are intended to be functional and useful to build powerful tools. They are not necessarily intended as end user tools but as components aimed at developers. Documentation and UX is aimed at developers not end users.

Audience

The Moby Project is intended for engineers, integrators and enthusiasts looking to modify, hack, fix, experiment, invent and build systems based on containers. It is not for people looking for a commercially supported system, but for people who want to work and learn with open source code.

Relationship with Docker

The components and tools in the Moby Project are initially the open source components that Docker and the community have built for the Docker Project. New projects can be added if they fit with the community goals. Docker is committed to using Moby as the upstream for the Docker Product. However, other projects are also encouraged to use Moby as an upstream, and to reuse the components in diverse ways, and all these uses will be treated in the same way. External maintainers and contributors are welcomed.

The Moby project is not intended as a location for support or feature requests for Docker products, but as a place for contributors to work on open source code, fix bugs, and make the code more useful. The releases are supported by the maintainers, community and users, on a best efforts basis only, and are not intended for customers who want enterprise or commercial support; Docker EE is the appropriate product for these use cases.


Legal

Brought to you courtesy of our legal counsel. For more context, please see the NOTICE document in this repo.

Use and transfer of Moby may be subject to certain restrictions by the United States and other governments.

It is your responsibility to ensure that your use and/or transfer does not violate applicable laws.

For more information, please see https://www.bis.doc.gov

Licensing

Moby is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.