COPY with docker but with exclusion

前端 未结 7 2138
轮回少年
轮回少年 2020-12-12 11:48

In a Dockerfile, I have

COPY . .

I want to exclude an entire directory, in my case, node_modules directory.

Something like this:

7条回答
  •  孤城傲影
    2020-12-12 12:40

    Excluding node_modules from current directory

    node_modules
    

    Excluding node_modules in any immediate subdirectories

    */node_modules
    

    Here is the official docs

提交回复
热议问题