leezu opened a new pull request #18115:
URL: https://github.com/apache/incubator-mxnet/pull/18115


   ## Description ##
   This PR shows how to get rid of duplicate Dockerfiles and the `install/X.sh` 
code deduplication strategy on the example of CentOS7 Dockerfiles. Instead, we 
use a single templated Dockerfile with a multiple targets for different 
scenarios. The template arguments and respective targets are declared in 
`docker-compose.yml`.
   
   This has multiple benefits:
   
   1) Having a single Dockerfile instead of a number of scripts is easier to 
understand and maintain
   2) Copying scripts into the Dockerfile as done in the previous approach 
prevents usage of the https://hub.docker.com/u/mxnetci/ cache on developer 
machines, as the `COPY` instruction invalidates the cache if the local 
repository does not match the repository used on CI (eg. development branch 
instead of master branch). If the cache is invalidated, developers must wait 
for long docker build time when attempting to reproduce certain CI builds (such 
as website build, cc @aaronmarkham) or using the docker image to perform the 
staticbuild.
   3) Having fewer steps in the Dockerfile improves the build speed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to