我有一个带有云虚拟机的 Docker Swarm 集群,当我尝试使用“--mount”选项而不是“-v”选项运行容器时(因为它不存在docker service create
,所以出现以下错误:
"starting container failed: hcsshim::CreateComputeSystem 1a2e90d47b6293fbd3be7168c93c110ff8cc620733b3ad8fe0d77de0c60ee5e3: The request is not supported.
(extra info: {"SystemType":"Container","Name":"1a2e90d47b6293fbd3be7168c93c110ff8cc620733b3ad8fe0d77de0c60ee5e3","Owner":"docker","VolumePath":"\\\\?\\Volume{a18f50d0-153f-4b54-8e81-c297317d2136}","IgnoreFlushesDuringBoot":true,"LayerFolderPath":"C:\\ProgramData\\docker\\windowsfilter\\1a2e90d47b6293fbd3be7168c93c110ff8cc620733b3ad8fe0d77de0c60ee5e3","Layers":[{"ID":"4381cd23-3415-50e7-a31f-cc48646ad7c7","Path":"C:\\ProgramData\\docker\\windowsfilter\\8425a66cc59c577ece9be2e9969fc18b27df0b8b9d93f718b92c04bbb17bf28e"},{"ID":"6cf9bec4-9afe-52a1-81d6-e18e419df8f1","Path":"C:\\ProgramData\\docker\\windowsfilter\\0878961a7b84cd31a8b1f3928085af81a84227efd91ceae6a2e0eac44997b45e"},{"ID":"86deebca-0ae1-5344-b771-063f2ad38e54","Path":"C:\\ProgramData\\docker\\windowsfilter\\31a7c11425d770dd65dc44bca828ac16dc72b9a59742a34f794d655ffeb8c073"},{"ID":"46e038a7-7bea-5c1d-87d6-d6d3048dacd0","Path":"C:\\ProgramData\\docker\\windowsfilter\\a365eb45c0d7dda81507ac878f89e4e268e815285471919e8fa4b0b472dae9cf"},{"ID":"0717381c-d70d-584a-ba8d-c963b97cf8f1","Path":"C:\\ProgramData\\docker\\windowsfilter\\39cb1cd4b050631643533fffdc40ca4fbc827f216a6181632544b2b655bfc26e"},{"ID":"8c52bac8-0d75-5338-bb16-003f64cf0198","Path":"C:\\ProgramData\\docker\\windowsfilter\\4e2c07c945e6d32deafa21d3b28a858c3b3c14ea9740ff975317aae81d3d2237"},{"ID":"f944baab-2ed4-549a-88a6-dda7aa6f20cf","Path":"C:\\ProgramData\\docker\\windowsfilter\\c02bbae1e2a48db238de78ac82077252d40819700ed6413b7eee4cd24cd4434f"},{"ID":"75926c63-459b-55db-8f37-a35c79430bb4","Path":"C:\\ProgramData\\docker\\windowsfilter\\9a449444e233cae47fbf831fb9118a1d525317f3f4cf0592793ecc7c00909489"},{"ID":"ba1dff8b-3eae-5a7d-b6f5-8a6ef86e0152","Path":"C:\\ProgramData\\docker\\windowsfilter\\68c24c7fec32a2da03a4f11f5971afcfd1da772c3be09f91f93905c2814443ac"},{"ID":"9f8badee-42d8-5b22-9388-79a68addebe9","Path":"C:\\ProgramData\\docker\\windowsfilter\\b3ff27c178ce49f20255c9b4d88705db01014baee31772b7f9de3b0426ff7ca9"},{"ID":"90a79b7b-4f75-5d13-b500-b3ab60871059","Path":"C:\\ProgramData\\docker\\windowsfilter\\bbdd9c2ad84ab7e3c00940f95982b3e0e8ae64cbf022a36ca773d1645b796973"},{"ID":"2488fb23-500a-566b-97bc-6f9133b8dd56","Path":"C:\\ProgramData\\docker\\windowsfilter\\1e81d276ba3ed87ed714e4b8af301daceddad943d38ba8eb6650016017453060"},{"ID":"704560d1-f2c5-5c6d-80be-02c894b44221","Path":"C:\\ProgramData\\docker\\windowsfilter\\63978c584fc9184dcd6f7c2ec953b3e1ac587258e2462ad109c21de645665cd8"},{"ID":"d670d883-6d44-5a13-a8bd-41177d3f2ac8","Path":"C:\\ProgramData\\docker\\windowsfilter\\3a6adae0488abd9a76be82f4f71727961159dfb8a05e5fe4ba8252a00d2f7274"},{"ID":"5868eb58-5d45-5aa6-aee0-a5ad05cbf269","Path":"C:\\ProgramData\\docker\\windowsfilter\\8cb7eb98fbd1d1055f3b9ca695b25cacf84889625777a29edd436c5e9f390379"},{"ID":"3995d88f-3647-560c-b321-39d7795412bd","Path":"C:\\ProgramData\\docker\\windowsfilter\\181a1893c651374b59f1f2868b754423c9215f556cacb61eea468eec9e1c9273"},{"ID":"431cbb9a-e9be-5436-9c17-7ae8575aada3","Path":"C:\\ProgramData\\docker\\windowsfilter\\5ecfa22985c2cb214719b79bbea1bc791b2aa4c99a7db6ee0cfd3432aa4d218a"},{"ID":"750fbc48-f9c1-55bc-8512-0af61aeb0a95","Path":"C:\\ProgramData\\docker\\windowsfilter\\ca63b6af8c5d92ca093521e944838a435dd26bfb2b85c37bd9f93a2b47976a29"},{"ID":"e3ae4f7e-fa3d-5b6d-bf85-b33411a80627","Path":"C:\\ProgramData\\docker\\windowsfilter\\5dec0053be676f1f7181f8059101b54e4a7d96b524fa98beea67e48737fc6b11"}],"ProcessorMaximum":10000,"MemoryMaximumInMB":4096,"HostName":"database","MappedDirectories":[{"HostPath":"G:\\sql","ContainerPath":"C:\\wfgen\\sql","ReadOnly":false,"BandwidthMaximum":0,"IOPSMaximum":0,"CreateInUtilityVM":false},{"HostPath":"C:\\ProgramData\\docker\\volumes\\f1e4209f9d802e1293a904ce423c43efbf377d0e5857e794963fa0261f070605\\_data","ContainerPath":"c:\\wfgen\\sql","ReadOnly":false,"BandwidthMaximum":0,"IOPSMaximum":0,"CreateInUtilityVM":false},{"HostPath":"C:\\ProgramData\\docker\\containers\\1a2e90d47b6293fbd3be7168c93c110ff8cc620733b3ad8fe0d77de0c60ee5e3\\mounts\\secrets","ContainerPath":"C:\\ProgramData\\Docker\\internal\\secrets","ReadOnly":true,"BandwidthMaximum":0,"IOPSMaximum":0,"CreateInUtilityVM":false}],"HvPartition":false,"EndpointList":["36888706-13FA-4C3D-9C6D-2936E4CC557B"],"AllowUnqualifiedDNSQuery":true})"
我实际使用的命令:
docker service create `
--name database `
--env-file .\database.env `
--mount 'type=bind,src=G:/sql,dst=C:/wfgen/sql' `
--secret SA_PASSWORD `
--secret WFGEN_DATABASE_USER_USERNAME `
--secret WFGEN_DATABASE_USER_PASSWORD `
--secret WFGEN_ADMIN_PASSWORD `
--limit-cpu '2' `
--limit-memory '4G' `
--hostname database `
advantys/workflowgen-sql-express:7.15.5-win-ltsc2019
如果我删除“--mount”参数,它就可以正常工作。此外,当我在 Windows 10 上使用相同参数时,如果未加入 Swarm,也会出现同样的错误。但是,再次强调,使用“-v”参数就可以正常工作。
我在网上和 Github(moby/moby 和 docker-for-win)上搜索可能遇到同样问题的人,但一无所获。有没有遇到过类似错误的人可以告诉我为什么这不起作用或给出一些答案?
版本信息:
Client: Docker Engine - Enterprise
Version: 19.03.1
API version: 1.40
Go version: go1.12.5
Git commit: f660560464
Built: 07/25/2019 20:59:52
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Enterprise
Engine:
Version: 19.03.1
API version: 1.40 (minimum version 1.24)
Go version: go1.12.5
Git commit: f660560464
Built: 07/25/2019 20:57:41
OS/Arch: windows/amd64
Experimental: false