无法在Windows 10上复制到Windows容器('docker cp') [英] Unable to copy to Windows container ('docker cp') on Windows 10
问题描述
我在笔记本电脑上为Windows设置了Docker,并在Docker的设置中从 Linux容器切换到 Windows容器(这提示了几次重新启动和Windows更新).我使用以下命令拉出图像并运行基于该图像的容器:
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:/
并收到以下错误消息:
守护程序的错误响应:不支持针对正在运行的Hyper-V容器的文件系统操作
Error response from daemon: filesystem operations against a running Hyper-V container are not supported
我搜索了此错误,但是没有(解释性的)出现,非常令人惊讶.有什么方法可以在Windows 10上将图像作为Windows容器而不是Hyper-V容器运行?
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?
最终,我会将这个容器部署到Windows Server 2016主机上,但是我需要在运行Windows 10 Pro的笔记本电脑中进行所有开发和测试.
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版本
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
推荐答案
基于@GregorySuvalian的评论,我了解Windows 10仅允许Hyper-V运行时.因此,我的解决方法是停止容器,运行docker cp
命令,然后重新启动容器. (我更喜欢设置音量,因为它只是一次操作.)
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.)
这篇关于无法在Windows 10上复制到Windows容器('docker cp')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!