docker - Is there any reason to favour concatenated RUN directives over RUNning a script? -


when i'm creating dockerfile generate image, have options when comes installing , building stuff.

i do

run && \     b && \      c 

or

copy install.sh /install.sh run /install.sh 

where install.sh is

a b c 

are there substantial reasons favour 1 approach on other?

in contrast other answer, prefer:

run && \     b && \      c 

the main reason being clear happening. if instead use script, you've hidden code. new user understand what's happening, need find project build context before can script.

it trade-off , once things complex, should refactor script. however, might prefer curl script known location rather copy it, dockerfile remains standalone.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -