[TriLUG] Shrinking docker images

Aaron Joyner via TriLUG trilug at trilug.org
Mon Oct 24 10:45:41 EDT 2016


You might want to investigate if there's a Unikernel (
https://en.wikipedia.org/wiki/Unikernel) implementation for Mono.  AtamanOs
(https://github.com/atmanos/atmanos) is a highly experimental variation on
that theme for Go.  The basic idea is "a library that allows your binary to
be invoked by and communicate directly with the hypervisor" or "ditch *all* of
that OS, you don't need any of it".

Disclaimer: I don't have any first-hand experience which would recommend
this for anything you want to be reliable.  The technology is still it its
very early days.

On Mon, Oct 24, 2016 at 9:53 AM, Greg Cox via TriLUG <trilug at trilug.org>
wrote:

> Tried it your way, got a 322M image.
>
> =====
> FROM ubuntu:latest
> RUN apt-get update && apt-get --no-install-recommends --no-install-suggests
> -y install mono-runtime curl unzip mono-vbnc && rm -rf /var/lib/apt/lists/*
> WORKDIR /yWriter6
> RUN curl -SL -o /tmp/yWriter.zip http://www.spacejock.com/
> files/yWriter6.zip
> && unzip -d /yWriter6 /tmp/yWriter.zip && rm -f /tmp/yWriter.zip
> CMD mono bin/yWriter.exe
> =====
> ^ 203M image.
>
> Ubuntu:latest is 127M, and yWriter.zip is 4M unzipped.  Unless you can cut
> some muscle, or use a super-stripped distro like Igor suggests, there's the
> obvious fat I can see to cut.
>
> On Mon, Oct 24, 2016 at 7:28 AM, J. S. Evans via TriLUG <trilug at trilug.org
> >
> wrote:
>
> > It's actually really simple, but mono has a lot of dependencies, whether
> > they are actually needed or not, I don't know.
> >
> > FROM ubuntu:latest
> > RUN apt-get update && apt-get install mono-runtime wget unzip mono-vbnc
> > RUN mkdir /yWriter6
> > RUN cd /yWriter6
> > RUN wget http://www.spacejock.com/files/yWriter6.zip
> > RUN unzip yWriter6.zip
> > CMD mono bin/yWriter6.exe
> >
> >
> > On 10/24/16 07:09, Greg Cox wrote:
> >
> >> You might want to post a redacted Dockerfile for us to poke at.
> >>
> >>
> >> That said, I trim a bit off my images by my package-installer RUN being:
> >>
> >> RUN apt-get update && \
> >> apt-get --no-install-recommends --no-install-suggests -y install PKG1
> >> PKG2 && \
> >> rm -rf /var/lib/apt/lists/*
> >>
> >>
> >>
> >> On 23 Oct 2016, at 23:48, J. S. Evans via TriLUG <trilug at trilug.org>
> >>> wrote:
> >>>
> >>> Is there an application that can delete non-essential parts of a docker
> >>> image?  For example, I wrote a docker image to run a windows app with
> mono
> >>> using the stock Ubuntu base image. The image works and the container
> that I
> >>> create with it runs the app, but after the image was built, it was >
> 300MB.
> >>> I would like to know if there is an easy way to determine what parts
> of the
> >>> filesystem would be safe to delete.
> >>>
> >>> My guess would be to run ps while it is running and delete anything
> >>> that's not needed such apt/dpkg or anything in /var, /usr/local, etc.
> Does
> >>> anyone know of an application that I could run that would do this for
> me
> >>> without the headache?
> >>>
> >>> Jason
> >>>
> >>
> > --
> > This message was sent to: glcox at pobox.com <glcox at pobox.com>
> > To unsubscribe, send a blank message to trilug-leave at trilug.org from
> that
> > address.
> > TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> > Unsubscribe or edit options on the web  : http://www.trilug.org/mailman/
> > options/trilug/glcox%40pobox.com
> > Welcome to TriLUG: http://trilug.org/welcome
> --
> This message was sent to: Aaron S. Joyner <aaron at joyner.ws>
> To unsubscribe, send a blank message to trilug-leave at trilug.org from that
> address.
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web  : http://www.trilug.org/mailman/
> options/trilug/aaron%40joyner.ws
> Welcome to TriLUG: http://trilug.org/welcome
>


More information about the TriLUG mailing list