Unable to copy to Windows container ('docker cp') on Windows 10

拈花ヽ惹草 提交于 2020-01-13 07:46:10

问题


I set up Docker for Windows on my laptop and switched from Linux Containers to Windows Containers in Docker's settings (which prompted a couple of restarts and Windows updates). I pulled an image and ran a container based on it using the commands:

docker pull microsoft/dotnet-framework
docker run -it microsoft/dotnet-framework cmd

In a second terminal window, I executed the command:

docker cp app container_id:/

and received this error message:

Error response from daemon: filesystem operations against a running Hyper-V container are not supported

I googled this error, but nothing (explanatory) came up, quite surprisingly. Is there a way I can run the image as a Windows container rather than a Hyper-V container, on Windows 10?

Ultimately, I will deploy this container to a Windows Server 2016 host, but I need to do all development and testing in my laptop running Windows 10 Pro.

Docker Version

Client:
 Version:      17.06.0-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:30:30 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.06.0-ce
 API version:  1.30 (minimum version 1.24)
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 22:19:00 2017
 OS/Arch:      windows/amd64
 Experimental: true

回答1:


Based on a comment by @GregorySuvalian, I understand that Windows 10 allows Hyper-V runtime only. So my workaround is to stop the container, running the docker cp command and restart the container. (I preferred this over setting up a volume, since it is just a one time operation.)



来源:https://stackoverflow.com/questions/45654570/unable-to-copy-to-windows-container-docker-cp-on-windows-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!