Docker:复制内容以挂载驱动器

时间:2019-07-15 18:11:03

标签: docker dockerfile

我试图实现的目标非常简单,在基于Windows的映像中创建R驱动器,然后将其复制到其中。

尝试1:

R:>docker build --tag=myteam/some_apps:version1.0.0 . --build-arg hostip=10.13.247.12
Sending build context to Docker daemon 337.8MB
Step 1/40 : FROM mcr.microsoft.com/dotnet/core/runtime:2.1
—> 63ccc9aeb7f1
Step 2/40 : VOLUME R:\Apps
—> Using cache
—> 6eb44e6f3ecc
Step 3/40 : VOLUME R:\Data
—> Using cache
—> b39d1b2f6325
Step 4/40 : COPY .\Apps R:\Apps
invalid COPY: Windows does not support destinations not on the system drive (C:)

尝试2:我尝试了另一种方法(首先将其复制到容器中的C:\ Apps,然后从C:\ Apps复制到容器中的R:\ Apps),但没有任何乐趣:

R:>docker build --tag=myteam/some_apps:version1.0.0 . --build-arg hostip=10.13.247.12
Sending build context to Docker daemon 337.8MB
Step 1/41 : FROM mcr.microsoft.com/dotnet/core/runtime:2.1
—> 63ccc9aeb7f1
Step 2/41 : RUN mkdir “C:\Apps”
—> Running in c62cb0e46e7d
Removing intermediate container c62cb0e46e7d
—> a0967376d99f
Step 3/41 : COPY . .
—> d132bac8bf47
Step 4/41 : VOLUME R:\Apps
—> Running in 5177d78beb72
Removing intermediate container 5177d78beb72
—> 83a27df9d828
Step 5/41 : RUN copy C:\Apps R:\Apps
—> Running in 720713ea754d
container 720713ea754d223e39237053b5aa9222ae2d0da19bd251a3398e438bd6d26f29 encountered an error during Start: failure in a Windows system call: The virtual machine or container exited unexpectedly. (0xc0370106)

谢谢!

0 个答案:

没有答案