Skip to content
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

Docker file container size optimization. #22

Open
leftyb opened this issue Feb 1, 2016 · 9 comments
Open

Docker file container size optimization. #22

leftyb opened this issue Feb 1, 2016 · 9 comments
Assignees

Comments

@leftyb
Copy link
Contributor

leftyb commented Feb 1, 2016

We need to provide a more "light weight" container for the community users and for our own better production experience.
There are various technics to reduce the size of the container.

https://www.ctl.io/developers/blog/post/optimizing-docker-images/
http://www.developer.com/design/a-guide-to-docker-image-optimization.html
http://blog.tutum.co/2014/10/22/how-to-optimize-your-dockerfile/

@leftyb leftyb self-assigned this Feb 1, 2016
@deruelle
Copy link
Member

deruelle commented Feb 4, 2016

http://thenewstack.io/microcontainers-iron-ios-new-hack-shrink-docker-containers/
I think it's worth investigating at some point indeed
our docker image is too monolithic
ideally we should layer it better
create one for SIP Servlets that's layered on top of JBoss one
and create the REstComm one layered on top of SIP Servlets
when we think of it
true, but I wonder at what cost all this comes...
we don't need to download the whole zip everytime
we just need to upgrade the war files and a couple of conf files
which is much less than 300 MB
every time

@deruelle
Copy link
Member

deruelle commented Feb 4, 2016

Breakdown of our usage https://imagelayers.io/?images=mobicents%2Frestcomm:latest

@leftyb
Copy link
Contributor Author

leftyb commented Feb 4, 2016

Amazing application.

Thank you Jean.

@hamsterksu
Copy link
Collaborator

hi @deruelle @leftyb
i have split restcomm docker image to 2 images:

  1. restcomm/baseimage:java7 - 861 MB
  2. restcomm/restcomm - 1.127 GB (include 861MB base image)

Container's update size ~ 270 MB

https://github.com/hamsterksu/restcomm-docker-v2/tree/master

solution 2

i think it's possible to split it to 3 images

  1. restcomm/baseimage:java7
  2. restcomm/restcomm-sip-servlets:as7
  3. restcomm/restcomm

but in this case we need to move a lot of changes in restomm-sip-servlets like there - https://github.com/RestComm/Restcomm-Connect/blob/master/release/build.xml#L151
i'm not sure it's good idea

solution 3

Another possible solution split it to 3 images

  1. restcomm/baseimage:java7
  2. restcomm/restcomm-base:as7
  3. restcomm/restcomm

to build restcomm/restcomm-base:as7 we can download restcomm-connect AS7 and remove all wars from deployments except sip-servlets and webrtc and mediaserver

so restcomm/restcomm will bring restcomm, olympus, restcomm-management, visual-designer and mediaserer apps only

solution 4

Another possible solution split it to 5 images

  1. restcomm/baseimage:java7
  2. restcomm/restcomm-base:as7 (sip-servlets, webrtc)
  3. restcomm/restcomm:as7 (restcomm, restcomm-management)
  4. restcomm/mediaserver:as7 (mediaserver)
  5. restcomm/olympus:as7 (olympus)

and use docker compose to run restcomm

to use all in one

  • restcomm/restcomm:aio (as now)

WDYT?

@hamsterksu
Copy link
Collaborator

@deruelle
Copy link
Member

@hamsterksu nice !

Would you like to make a pull request so that @leftyb can review ?

@hamsterksu
Copy link
Collaborator

hamsterksu commented Nov 24, 2016

@deruelle
i have not tested solution #4 pretty well. it's just a concept.
i want to know your opinion

@deruelle
Copy link
Member

@gvagenas @leftyb can you comment on that ?

@leftyb
Copy link
Contributor Author

leftyb commented Nov 29, 2016

Hi @hamsterksu,

Thank you for the suggestion. I will need to make some tests following this approach to confirm. I am not sure that this approach is changing the download size, as by default docker updates only the layers that have changed, when you update a container. So maybe at the first update after pulling the container will result in less downloadable data, but after that, for pulling just new container where RC version/build has only been changed maybe the data to download will be the same, with the way we are using it now. But I can not say 100% will try to make some tests and will update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants