简体   繁体   中英

inside Docker container how to access shared volume

I am trying to create Docker file by installing .net core feature. For that we need to have source file so i have my sources file in D:\\ and it was shared with full access. Below is my docker file.

> # escape=` FROM microsoft/iis  SHELL ["powershell", "-command"]
> # Install ASP.NET RUN Install-WindowsFeature NET-Framework-45-ASPNET; `  
>     Install-WindowsFeature Web-Asp-Net45 RUN Install-windowsFeature -Name net-framework-core -Source \\node2\D\sources\sxs;`
>     Install-WindowsFeature WEB-ASP-net -Source \\node2\D\sources\sxs

Can we access the sources file like this -Source \\node2\\D\\sources\\sxs. i have tried this but this is not working. Can you suggest the best way to do this. We can copy the files inside to the containe and install

No you can't. Docker as of now doesn't allow you to Mount folders while building images. They are only available while running containers. So you need to copy them to your current context. Send it as a part of build context and then use it.

Other way around would be setup a ftp or a http server on your machine folder the required folder and then in your docker build you will download these files from that URL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM