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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -