-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oracle database image size is huge #896
Comments
Yes, you can use the If you look at the Dockerfile you will see that the RUN commands are pretty much already all merged. |
@gvenzl Thanks, the
However, as you can see the prebuilt image per the docs doesn't stay lean. Do you have any recommendations for cutting down the size of the prebuilt image? I'm testing docker-squash as I'm writing this... |
Update on squashing. the library I linked doesn't work, so I ended up using this instead: https://github.com/goldmann/docker-squash result;
So it saves a decent 1/2 GB, but 9GB still seems pretty chunky for a totally empty database... |
The image gets bigger because you have data files in the image now, which come with default sizes. If you want to have a smaller image but still with a pre-built database there is a great blog post on the Mobiliar Database Blog which shows you a couple of tricks to make some data files and tablespaces even smaller. Their case was for 11g XE but the steps for reducing |
The runOracle.sh scripts is a lot different for xe-11 than 12 which makes this nice blog not that useful :/ |
The procedure to remove components from the database remains the same. |
@avindra The
|
Just note that @avindra image is bigger because he keeps a pre-built database inside the image as well (data files, etc). So he won't quite get to the 6GB :) |
We have now also implemented multi-stage builds by default which makes using the |
Hi @gvenzl. Thanks for the link! I'm actually trying to go through the instructions that Alain posted using 18c XE... with mixed success. I can't decrease the size of Also, I can't re-create |
I know this is old but I had this problem also and went with this approach which I describe here: But basically you get rid of the copy instructions by serving up the installers/patches via a local http server (you can do this with one command via python) That way you can download,extract and delete all in the one RUN instruction. Hope it helps |
p.s. obviously if you don't need credentials for downloading installers you could just download from a regular file repo (like artifactory) rather than serve them up locally |
I created a database image using your scripts:
REPOSITORY TAG IMAGE ID CREATED SIZE
oracle/database 12.2.0.1-ee 8adc010e6d91 13 minutes ago 13.2GB
when I check size of files using bash in container: 5.9G
Is it possible to shrink the size of image? I.e. you can merge RUN commands in your script and remove files immediately after install to avoid producing to many layers.
The text was updated successfully, but these errors were encountered: