gpt4 book ai didi

docker - 一个命令复制多个目录

转载 作者:IT老高 更新时间:2023-10-28 12:36:31 40 4
gpt4 key购买 nike

有什么方法可以在一个命令中复制多个目录,以减少层数?例如,而不是:

COPY dirone ./dirone
COPY dirtwo ./dirtwo
COPY dirthree ./dirthree

我想做:

COPY dirone/ dirtwo/ dirthree/ ./

但是,这会复制目录的内容...但我想复制目录本身

最佳答案

这是复制命令的记录行为:

If <src> is a directory, the entire contents of the directory are copied, including filesystem metadata.

Note: The directory itself is not copied, just its contents.

我可以建议的最佳解决方法是更改​​构建文件夹中的目录布局,将三个文件夹移动到一个父文件夹下并添加父文件夹。

关于docker - 一个命令复制多个目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37715224/

40 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com