potiuk commented on pull request #11352:
URL: https://github.com/apache/airflow/pull/11352#issuecomment-705725610


   
   > On examining i noticed that it is multi stage docker build , with a build 
image and the main image . All the dependencies are getting installed in 
builder image , then there is no need of this as after build main image is used 
and pushed .
   
   @Rajpratik71 . Exactly. That is not a good idea. We have multi-segmented 
build and the "pip install" step is done in the "build" segment. Then only 
installed Python libraries from "${HOME}/.local" are copied to the final image 
using COPY --from. It's actually even better to leave pip --cache because then 
it causes much faster rebuilds of the image. 
   
   In the build segment we run the pip install twice - the first time to run 
the "current master" dependencies and then, when we build the image, with the 
actual dependencies from sources. This way we get faster rebuilds when setup.py 
changes, we do not have to re-install everything from scratch when we iterate 
on the image (for example when we are running kubernetes tests). So removing 
cache in this case is not a good idea at all.
   
   
   


----------------------------------------------------------------
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