COPY with docker but with exclusion

前端 未结 7 2106
轮回少年
轮回少年 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:44

    For those using gcloud build:

    gcloud build ignores .dockerignore and looks instead for .gcloudignore

    Use:

    cp .dockerignore .gcloudignore

    Source

提交回复
热议问题