Hi Eranga, Squashing the image is a problematic approach for WSO2 products, as some configs that are done in the entrypoint script would also get saved in to the resulting flat image. For example, there are some operations that take the IP address of the container as an input. If we flatten the container to an image after this operation the result will cause confusion and the product would not start.
Regards, Chamila de Alwis Committer and PMC Member - Apache Stratos Software Engineer | WSO2 | +94772207163 Blog: code.chamiladealwis.com On Fri, Apr 1, 2016 at 12:50 PM, Eranga Perera <[email protected]> wrote: > Hi, > > To reduce the size of the docker image I found the following approaches > being used. Once the image if built we can merge the layers and flatten > [1]. Also can squash the docker image as in [2] > > [1] https://www.ctl.io/developers/blog/post/optimizing-docker-images/ > [2] https://github.com/jwilder/docker-squash > > On Fri, Apr 1, 2016 at 10:34 AM, Imesh Gunaratne <[email protected]> wrote: > >> >> >> On Fri, Apr 1, 2016 at 10:18 AM, Isuru Haththotuwa <[email protected]> >> wrote: >> >>> >>> >>> On Fri, Apr 1, 2016 at 12:45 AM, Imesh Gunaratne <[email protected]> wrote: >>> >>>> >>>> >>>> On Thu, Mar 31, 2016 at 7:56 PM, Isuru Haththotuwa <[email protected]> >>>> wrote: >>>> >>>>> >>>>> On Thu, Mar 31, 2016 at 4:47 PM, Imesh Gunaratne <[email protected]> >>>>> wrote: >>>>> >>>>>> >>>>>> On Thu, Mar 31, 2016 at 2:05 PM, Isuru Haththotuwa <[email protected]> >>>>>> wrote: >>>>>> >>>>>>> >>>>>>> [2]. >>>>>>> FROM wso2am:1.10.0 >>>>>>> MAINTAINER [email protected] >>>>>>> >>>>>>> COPY artifacts/ /mnt/wso2-artifacts/carbon-home >>>>>>> >>>>>> We are not using root user, and the relevant user (wso2user) has >>>>> permission to /mnt. Technically we can give permission to /opt as well, >>>>> but >>>>> IMHO we can have this directory in /mnt. Will change the name to >>>>> /mnt/wso2. >>>>> >>>> >>>> +1 May be /mnt/wso2/wso2<product-code> would be more meaningful. >>>> >>> IMHO since we run a single product in a container, using only 'wso2' is >>> enough. >>> >> >> +1 >> >> >>> >>>> Thanks >>>> >>>>> >>>>>> Shouldn't it better to use a simple folder structure like >>>>>> "/usr/local/wso2/wso2<product-code>/" instead of above? Apache Httpd [3], >>>>>> Tomcat [4], JBoss [5] Dockerfiles use something similar. >>>>>> >>>>>> [3] >>>>>> https://github.com/docker-library/httpd/blob/bc72e42914f671e725d85a01ff037ce87c827f46/2.4/Dockerfile#L6 >>>>>> [3] >>>>>> https://github.com/docker-library/tomcat/blob/ed98c30c1cd42c53831f64dffa78a0abf7db8e9a/8-jre8/Dockerfile#L3 >>>>>> [4] >>>>>> https://github.com/jboss-dockerfiles/wildfly/blob/master/Dockerfile#L7 >>>>>> >>>>>> Thanks >>>>>> >>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Thanks and Regards, >>>>>>> >>>>>>> Isuru H. >>>>>>> +94 716 358 048* <http://wso2.com/>* >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> *Imesh Gunaratne* >>>>>> Senior Technical Lead >>>>>> WSO2 Inc: http://wso2.com >>>>>> T: +94 11 214 5345 M: +94 77 374 2057 >>>>>> W: http://imesh.io >>>>>> Lean . Enterprise . Middleware >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Thanks and Regards, >>>>> >>>>> Isuru H. >>>>> +94 716 358 048* <http://wso2.com/>* >>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> *Imesh Gunaratne* >>>> Senior Technical Lead >>>> WSO2 Inc: http://wso2.com >>>> T: +94 11 214 5345 M: +94 77 374 2057 >>>> W: http://imesh.io >>>> Lean . Enterprise . Middleware >>>> >>>> >>> >>> >>> -- >>> Thanks and Regards, >>> >>> Isuru H. >>> +94 716 358 048* <http://wso2.com/>* >>> >>> >>> >> >> >> -- >> *Imesh Gunaratne* >> Senior Technical Lead >> WSO2 Inc: http://wso2.com >> T: +94 11 214 5345 M: +94 77 374 2057 >> W: http://imesh.io >> Lean . Enterprise . Middleware >> >> >> _______________________________________________ >> Architecture mailing list >> [email protected] >> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >> >> > > > -- > Eranga Perera > *Senior Lead Solutions Engineer* > *WSO2, Inc. * > Mobile : +94 72 778 4250 > [email protected] > > _______________________________________________ > Architecture mailing list > [email protected] > https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture > >
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
