小编典典

“ docker cp”将一个文件夹中的所有文件转移到现有容器文件夹中

docker

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

文件

我想将build(host)文件夹中的文件复制到容器中的html:

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

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

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

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

我是否缺少某些内容,还是必须一个一个地复制每个文件?


阅读 5338

收藏
2020-06-17

共1个答案

小编典典

这是有关如何在docker中使用CP命令的说明,它将/.SRC_PATH

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

SRC_PATH does end with /.
the content of the source directory is copied into this directory
2020-06-17