gvenzl / oci-oracle-free

Build scripts for Oracle Database FREE container/docker images
Apache License 2.0
130 stars 35 forks source link

Layer with rm #30

Closed bersace closed 10 months ago

bersace commented 10 months ago

Hi,

Using dive, I found an odd layer that may consume useless storage:

    160 MB  FROM 20e1a2aa083bdf6
    225 MB  rm    "${ORACLE_BASE}"/"${ORACLE_SID}".7z
    517 MB  #(nop) COPY file:2efe304a7c04050e4bc74c456c1e7730f031fdcd1c93894481c04b44e1d09bb8 in "$
    363 MB  #(nop) COPY dir:b28b60ad6aea46fa7d701e7ae629e192dfde627515d5f219a7718af6b2311698 in "${
    294 MB  #(nop) COPY dir:6e56135d09b2222d61c2c4dc926e0e6e2c3c0dab2cf9ad4a030d6172b0c8469c in "${
    261 MB  #(nop) ENTRYPOINT ["container-entrypoint.sh"]

The rm ....7z eats 225MB to remove a file. I guess its a bug.

What do you think of this?

Regards, Étienne

gvenzl commented 10 months ago

Hi @bersace,

Thanks a lot for using these images!

Although it might appear like a bug, that layer is actually intentional and includes parts of the ORACLE_HOME, see:

https://github.com/gvenzl/oci-oracle-free/blob/eae7d95203cafd152939b4881df14e13bb87f502/Dockerfile.23#L57-L68

The image is build like that on purpose so that it comes with multiple smaller layers that will all be pulled and extracted in parallel, rather than one big layer that will be pulled and then extracted serially.

Thanks,

bersace commented 10 months ago

OK. Understood. I catched the copy --from trick but I didn't thought this will still end up in dive as such.

Thanks for the explanation. Regards,