在Dockerfile中如何从网络驱动器复制文件 [英] In Dockerfile how to copy file from network drive

查看:126
本文介绍了在Dockerfile中如何从网络驱动器复制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 // somenetwork / somefiles / myfile

在我的 Dockerfile 中,我想:

COPY // somenetwork / somefiles / myfile / opt / files / file

是否可以通过 Dockerfile 实现?
谢谢

Is there anyway to achieve that with Dockerfile? thanks

推荐答案

考虑 ADD或COPY 使用 Dockerfile context (当前文件夹或

Not easily, considering ADD or COPY uses the Dockerfile context (the current folder or below) to seek their resources.

首先将该文件先 cp Dockerfile 文件夹(在 docker build之前。),并留在所说的 Dockerfile COPY myfile / opt / files / file 指令。

It would be easier to cp that file first to the Dockerfile folder (before a docker build .), and leave in said Dockerfile a COPY myfile /opt/files/file directive.

或者您可以运行容器,并使用< a href = http://docs.docker.com/engine/reference/commandline/cp/ rel = nofollow> docker cp // somenetwork / somefiles / myfile / opt / files / file 以便在rintime添加该文件

Or you could run the container, and use a docker cp //somenetwork/somefiles/myfile /opt/files/file to add that file at rintime

这篇关于在Dockerfile中如何从网络驱动器复制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆