Docker Image Size is almost 3GB using the provided Dockerfile
Hello,
I have a RHEL base image (200 MB) on which I have build the Server JRE image (added 150 MB) and then build on the top-the Weblogic Server Image 12.2.1.3 using the provided Docker file. This is resulting in a final image that is almost 3 gb (2.89 GB to be precise).
However, when I download the Oracle provided WLS 12.2.1.3 using the below command, it is only 1.14 GB. docker pull store/oracle/weblogic:12.2.1.3
Is the docker file not Size friendly /Multi-Staged? Please help. I will really appreciate it.
Thank you Chay
The WebLogic 12.2.1.3 image is built using the same Dockerfile but using the Oracle Linux slim and the Server JRE image. Could you do a docker history
Hello Monica,
I am following the instructions from 12.2.1.3 (generic) from the below URL for server JRE ( only changed first line in dockerfile to extend RHEL base image) and Weblogic Server.
https://github.com/oracle/docker-images/tree/master/OracleWebLogic/dockerfiles/12.2.1.3
I made one change since then that reduced the size from 2.89 GB to 2.05 GB.
COPY $FMW_PKG install.file oraInst.loc /u01/ RUN chown oracle:oracle -R /u01 to: RUN chown oracle:oracle -R /u01 COPY --chown oracle:oracle $FMW_PKG install.file oraInst.loc /u01/
However it is still over 2 GB.
I see from the history that RHEL is about 201 MB, JRE is about 152MB. But I see 839MB and 863MB added due to COPY --chown=oracle:oracle.. and cd /u01 && $JAVA_HOME/bin/jar xf … Statements in the docker file that is causing the image to bloat up.
Here is the history output
IMAGE CREATED CREATED BY SIZE COMMENT
4af03af2cc8d 17 seconds ago /bin/sh -c #(nop) CMD ["/u01/oracle/createA… 0B
9c13c7580447 17 seconds ago /bin/sh -c #(nop) WORKDIR /u01/oracle 0B
4a1a3bfad025 18 seconds ago /bin/sh -c cd /u01 && $JAVA_HOME/bin/jar xf … 863MB****
9dbe2a1084ac About a minute ago /bin/sh -c #(nop) USER oracle 0B
b07610202ce9 About a minute ago /bin/sh -c #(nop) COPY --chown=oracle:oracle 839MB
f542ee13d47b 2 minutes ago /bin/sh -c chown oracle:oracle -R /u01 && ch… 6kB
296b4d56b3d6 2 minutes ago /bin/sh -c #(nop) ENV FMW_PKG=fmw_12.2.1.3.… 0B
2d82303b4b0b 2 minutes ago /bin/sh -c #(nop) ENV DOMAIN_NAME=base_doma… 0B
bd11a8273205 2 minutes ago /bin/sh -c #(nop) COPY multi:7b1613647941238… 5.56kB
19880cda1498 2 minutes ago /bin/sh -c mkdir -p /u01 && chmod a+xr /… 296kB
ec83bbe0e530 2 minutes ago /bin/sh -c #(nop) ENV ORACLE_HOME=/u01/orac… 0B
9dad74677ab9 11 hours ago /bin/sh -c export JAVA_DIR=$(ls -1 -d /usr/j… 377B
95a5856ac5c0 11 hours ago /bin/sh -c #(nop) ADD file:f27f617b87b35c9a1… 152MB
dc01ae8f5f92 11 hours ago /bin/sh -c #(nop) ENV JAVA_PKG=server-jre-8… 0B
dfb5dc8ad64f 11 hours ago /bin/sh -c #(nop) MAINTAINER Chay Teegavara… 0B
7b875638cfd8 2 months ago 2.9kB
The Oracle Linux layer is 117MB and the Server JRE is about 162MB the 863 comes from the actual installation of the WebLogic binaries. The problem is the 839 in the bin/sh -c #(nop) COPY --chown=oracle:oracle 839MB. Let me look into this.
Sure, Thank you in advance!!
In the Dockerfile you can add "--squash" to the docker build command line to reduce the size.
Squash did help to compress the file considerably- Thank you. Any issues with it being considered an experimental feature?
I am still waiting on Monica's response on the docker file issue (COPY command) as it could reduce the size further.
The Oracle Linux layer is 117MB and the Server JRE is about 162MB the 863 comes from the actual installation of the WebLogic binaries. The problem is the 839 in the bin/sh -c #(nop) COPY --chown=oracle:oracle 839MB. Let me look into this.
Hi Monica,
Were you able to figure this out? Please let me know.
Thank you. Chay
I'm having a problem logging into Oracle to download the 12213-patch. I get an error page when clicking on the downloads link. I've registered but when I login it seems I have to go through some procress and I'm just stuck on that page - no links are clickable - just nothing happens - is there any other alternate way to get download the 12213-patch?
We need to connect your user account to a Support Identifier. Access and privileges are approved by an Administrator in your organization. You need to add at least one Support Identifier to proceed.
I'm not sure how to proceed from here!
@mommaroodles To download patches for WebLogic from support.oracle.com you must use My Oracle Support credentials. Thanks Monica
thank you !
Squash did help to compress the file considerably- Thank you. Any issues with it being considered an experimental feature?
I am still waiting on Monica's response on the docker file issue (COPY command) as it could reduce the size further.
Hi Monica,
Just Coming back from Holidays. I wanted to find out, has any work being done towards the issue I raised for the COPY command?
Thanks Chad