Dockerfile copy keep subdirectory structure

I’m trying to copy a number of files and folders to a docker image build from my localhost.

The files are like this:

folder1
    file1
    file2
folder2
    file1
    file2

I’m trying to make the copy like this:

COPY files/* /files/

However, all files are placed in /files/ is there a way in Docker to keep the subdirectory structure as well as copying the files into their directories?

4 Answers
4

Leave a Comment