ignore all .git folders in .dockerignore
It suffices to use the ** pattern. For example: .dockerignore **/.git The relevant passage from that page of the official doc is: .dockerignore file […] Matching is done using Go’s filepath.Match rules. A preprocessing step removes leading and trailing whitespace and eliminates . and .. elements using Go’s filepath.Clean. Lines that are blank after preprocessing … Read more