“docker cp”从一个文件夹的所有文件到现有的容器文件夹

当我尝试将文件从一个文件夹复制到现有的容器文件夹时,是否丢失了某些内容:

文件

我想要在构build(主机)文件夹中的文件复制到我的容器中的HTML:

docker cp ./src/build b081dbbb679b:/usr/share/nginx/html 

要清楚; 我需要从主机复制到容器。

但它会复制整个构build文件夹并将其复制到..html / build

我只需要build文件夹中的文件(和子文件夹)被复制到..html。

我错过了什么,或者我必须逐一复制每个文件?

下面是关于如何在docker中使用CP命令的解释,它将用/.来解决你的问题/.SRC_PATH结束

 SRC_PATH does not end with /. the source directory is copied into this directory SRC_PAPTH does end with /. the content of the source directory is copied into this directory