klesh commented on issue #9276:
URL: https://github.com/apache/devlake/issues/9276#issuecomment-6571972435

   Verified on the shipped image `apache/devlake:v1.0.3-beta19` (first beta 
containing this change) versus `v1.0.3-beta18`.
   
   Docker Hub, compressed size:
   
   | | beta18 | beta19 | delta |
   |---|---|---|---|
   | `apache/devlake` amd64 | 2411.4 MB | **516.6 MB** | −78.6% (4.7× smaller) |
   | `apache/devlake` arm64 | 2255.1 MB | **487.3 MB** | −78.4% |
   
   Layer breakdown from the image manifests:
   
   ```
   beta18                                          beta19
   COPY /go/bin /usr/bin              21.0 MB      (removed)
   COPY /app/bin /app/bin            979.8 MB      COPY /app/bin/lake   23.4 MB
   RUN chgrp/chmod -R 0 /app        1097.4 MB      RUN chgrp/chmod -R 0 /app  
186.5 MB
   ```
   
   The 979.8 MB layer is the 47 `.so` files. It is gone entirely, and the 
`chgrp -R` layer shrank from 1097.4 MB to 186.5 MB because there is far less to 
copy up.
   
   **Remaining opportunity:** that last `RUN chgrp -R 0 /app && chmod -R g=u 
/app` layer is 186.5 MB of the 516.6 MB total — a second full copy of `/app` 
purely to change ownership and mode. Applying `COPY --chown`/`--chmod` and 
doing the recursive chmod before the build artifacts land should remove most of 
it, for an image around 340 MB.


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

To unsubscribe, e-mail: [email protected]

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

Reply via email to