Re: Reduce the size of docker images for oracle database

From: Jacek Gębal <jgebal_at_gmail.com>
Date: Wed, 29 Apr 2020 22:51:30 +0100
Message-ID: <CACQ9E3uSPRYDB0dXY2umZ69uAmQD=ybgQEYjXO3symPwJA1b_w_at_mail.gmail.com>



To be honest I'm not a Docker expert.
I did some stuff for what we needed some time back. Maybe someone else _at_ oracle-l will know.

On Wed, 29 Apr 2020, 22:15 kunwar singh, <krishsingh.111_at_gmail.com> wrote:

> Ohk. I got your point, it explains. why i see them in the "docker history
> <image> "
>
> One last question if you dont mind :) .
>
> In your opinion what would be the best way to get a 12.2.0.1 Apr 2020 RU
> image build and it be less than 2GB or least possible and not like 16GB .
> And i want to be able to do this in future for any RU so want to script it
> as well.
>
>
>
> On Wed, Apr 29, 2020 at 4:57 PM Jacek Gębal <jgebal_at_gmail.com> wrote:
>
>> You will need to build brand new image in one go.
>> Squash only works on interim images created by docker in build process.
>> If you build on top of existing image all that image is still there.
>> Images are immutable.
>>
>> On Wed, 29 Apr 2020, 21:30 kunwar singh, <krishsingh.111_at_gmail.com>
>> wrote:
>>
>>> Jacek,
>>> Do you have scripts for creating patched RU image on top of enterprise
>>> edition minimal DBs as well? That is my end goal.
>>> Even if i use the cleanup.sh on my already created RU image and do a
>>> pre-build DB image .it doesnt remove the size from lower layers.
>>>
>>> REPOSITORY TAG IMAGE ID
>>> CREATED SIZE
>>> oracle/database-prebuild 12.2-ee-12.2.0.1-Apr2020 1585ca40d0dc
>>> 19 minutes ago 16.1GB <<<<<<< see grown to 16.1GB. i
>>> had run on the container in it using cleanup.sh
>>> oracle/database 12.2-ee-12.2.0.1-Apr2020 e36720d8bc19
>>> 21 hours ago 11.9GB
>>> oracle/database 12.2-ee 8e476050ec44
>>> 21 hours ago 6.23GB
>>>
>>> Next I will use your script to build the base image and see what happens
>>> after applying the patch.
>>>
>>>
>>>
>>>
>>> On Wed, Apr 29, 2020 at 8:43 AM kunwar singh <krishsingh.111_at_gmail.com>
>>> wrote:
>>>
>>>> Thanks! I'll check them out.
>>>>
>>>> On Wed, Apr 29, 2020 at 8:38 AM Jacek Gębal <jgebal_at_gmail.com> wrote:
>>>>
>>>>> I've mentioned it on twittersome time back.
>>>>> https://twitter.com/GebalJacek/status/1231206793700872201?s=19
>>>>>
>>>>> We went from 8.5GB to 2.5-3.5GB
>>>>>
>>>>> Compressed (on dockerhub) they are way smaller.
>>>>>
>>>>> Starrup time (including download from dockerhub) is also very good.
>>>>>
>>>>> On Wed, 29 Apr 2020, 13:30 kunwar singh, <krishsingh.111_at_gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Thanks much for the reply Jacek! I will surely check your scripts :)
>>>>>> . Appreciate your inputs.
>>>>>>
>>>>>> I have a question if you don't mind.
>>>>>> Can you please tell me how much space reduction at image level did
>>>>>> you achieve with these scripts. I am yet to test your scripts to see for
>>>>>> myself, waiting for a new machine to get allocated for my testing.
>>>>>> Also which file tells what all things you removed.
>>>>>>
>>>>>> Cheers,
>>>>>> Kunwar
>>>>>>
>>>>>>
>>>>>> On Wed, Apr 29, 2020 at 7:19 AM Jacek Gębal <jgebal_at_gmail.com> wrote:
>>>>>>
>>>>>>> We're using slimmed images for utPLSQL.
>>>>>>>
>>>>>>> From 11gR2 to 19c
>>>>>>> They work fine for our needs though we've removed some things that
>>>>>>> might be needed in some other cases.
>>>>>>> See:
>>>>>>>
>>>>>>> https://github.com/utPLSQL/docker-scripts
>>>>>>>
>>>>>>> We use CDB-only to make DB even smaller.
>>>>>>> If you look at how DB is composed you'll see all the things we
>>>>>>> removed.
>>>>>>>
>>>>>>> Hope this helps
>>>>>>> Jacek
>>>>>>>
>>>>>>>
>>>>>>> On Tue, 28 Apr 2020, 23:50 sachin pawar, <getsach_at_gmail.com> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> I haven't tested, but this article from Franck may help you.
>>>>>>>>
>>>>>>>>
>>>>>>>> https://blog.dbi-services.com/the-size-of-oracle-home-from-9gb-to-600mb/
>>>>>>>>
>>>>>>>>
>>>>>>>> Rgds,
>>>>>>>> Sachin Pawar
>>>>>>>> https://twitter.com/sach_pwr
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Apr 28, 2020 at 5:02 PM kunwar singh <
>>>>>>>> krishsingh.111_at_gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hi Listers,
>>>>>>>>> I am researching on squash option to reduce this apr 2020 RU size
>>>>>>>>> to few GBs only .
>>>>>>>>>
>>>>>>>>> [oracle_at_testserver testdocker]$ docker image ls
>>>>>>>>> REPOSITORY TAG IMAGE ID
>>>>>>>>> CREATED SIZE
>>>>>>>>> oracle/database 12.2-ee-12.2.0.1-Apr2020 10sdsdfdsf21
>>>>>>>>> 24 minutes ago 11.9GB
>>>>>>>>> oracle/database 12.2-ee 614d36d3fzza
>>>>>>>>> 22 hours ago 6.24GB
>>>>>>>>>
>>>>>>>>> Can i reduce the size of this Apr2020 ru image to like 2gb with a
>>>>>>>>> pre-built database or something if my plan is to run just few queries in
>>>>>>>>> the image for multiple users. So maybe the build of base image (
>>>>>>>>> 12.2.0.1-ee ) will have to be done .
>>>>>>>>>
>>>>>>>>> I read squash option , but i am not sure if i can run squash on
>>>>>>>>> the April 2020 image in order to do that.
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Cheers,
>>>>>>>>> Kunwar
>>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Cheers,
>>>>>> Kunwar
>>>>>>
>>>>>
>>>>
>>>> --
>>>> Cheers,
>>>> Kunwar
>>>>
>>>
>>>
>>> --
>>> Cheers,
>>> Kunwar
>>>
>>
>
> --
> Cheers,
> Kunwar
>

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Apr 29 2020 - 23:51:30 CEST

Original text of this message