How to copy multiple files in one layer using a Dockerfile? -
the following dockerfile contains 4 copy layers:
copy readme.md ./ copy package.json ./ copy gulpfile.js ./ copy __build_number ./ how copy these files using 1 layer instead? following tried:
copy [ "__build_number ./", "readme.md ./", "gulpfile ./", "another_file ./", ]
copy readme.md package.json gulpfile.js __build_number ./ or
copy ["__build_number", "readme.md", "gulpfile", "another_file", "./"] you can use wildcard characters in sourcefile specification. see docs little more detail.
directories special! if write
copy dir1 dir2 ./ that works like
copy dir1/* dir2/* ./ if want copy multiple directories (not contents) under destination directory in single command, you'll need set build context source directories under common parent , copy parent.
Comments
Post a Comment