Using Docker ADD command for multiples files

Usually, you would end up putting all the relevant files into a sub-directory, and then just ADD that directory, to bring them into the image.


The ADD command and COPY both allow Golang's filepath.Match wildcards

You can find a number of examples in the test code for Go: https://golang.org/src/pkg/path/filepath/match_test.go

Rules reproduced here for those in China who can't access Google/golang.org:

    '*'         matches any sequence of non-Separator characters
    '?'         matches any single non-Separator character
    '[' [ '^' ] { character-range } ']'
                character class (must be non-empty)
    c           matches character c (c != '*', '?', '\\', '[')
    '\\' c      matches character c

character-range:
    c           matches character c (c != '\\', '-', ']')
    '\\' c      matches character c
    lo '-' hi   matches character c for lo <= c <= hi

Tags:

Docker

Regex