Using the Docker ADD Command for Multiple Files

I want to copy some files to my images, and I want to use the ADD command. I read in the Docker documentation about regex for ADD, but I don't know which expression I can use?

I need something like this

FROM registry:5000/ubuntu:14.04 MAINTAINER Me # some stuffs ADD Sources/{file1,file2,load_file} /etc/Sources/ # more stuffs 

Note: the expression is incorrect, but I did it to show you what I expect from the ADD command. (I thought about it in shell regular expressions).

So how can I do this? I can not access the filepath.Match link. If anyone has these rules, let me know?

Update

I am using this link docker docs

I am using this version:

 Client version: 1.3.0 Client API version: 1.15 Go version (client): go1.3.3 Git commit (client): c78088f OS/Arch (client): linux/amd64 Server version: 1.3.0 Server API version: 1.15 Go version (server): go1.3.3 Git commit (server): c78088f 
+10
regex docker
source share
3 answers

ADD and COPY both allow Golang filepath.Match wildcards

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

The rules reproduced here for those in China who cannot 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 
+20
source share

Usually you put all the relevant files in a subdirectory, and then just ADD this directory to bring them to the image.

+4
source share

An example of how to add ext SO files to a directory:

 ADD modules/*.so /usr/local/apache2/modules/ 

or you can add all files to the directory

 ADD modules/* /usr/local/apache2/modules/ 
0
source share

All Articles