4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

.dockerignoreでは**(任意階層にマッチするワイルドカード)が使える

Posted at

日本語のリファレンスには書いていないけど、英語版にはちゃんと書いてあった。

Beyond Go’s filepath.Match rules, Docker also supports a special wildcard string ** that matches any number of directories (including zero).

他の書き方も含めてまとめると下記のようになる。

# トップディレクトリ、および全ての子孫ディレクトリにあるnode_modulesを除外
**/node_modules

# トップディレクトリ直下のnode_modulesだけ除外
node_modules

# トップディレクトリの子ディレクトリのnode_modulesだけ除外
*/node_modules

# トップディレクトリの孫ディレクトリのnode_modulesだけ除外
*/*/node_modules
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?