Skip to content

Optimize gimie container size #95

@supermaxiste

Description

@supermaxiste

Currently the gimie container for x86 stands at ~815MB divided as follows (docker history command):

Layer                                           size
RUN /bin/sh -c useradd -ms /bin/bash gimie_u…   332kB     
COPY .docker/entrypoint.sh /entrypoint.sh # …   215B      
COPY /app /app # buildkit                       582MB     
RUN /bin/sh -c set -eux;   savedAptMark="$(a…   12.2MB    
RUN /bin/sh -c set -eux;  for src in idle3 p…   32B       
RUN /bin/sh -c set -eux;   savedAptMark="$(a…   29.6MB    
ENV GPG_KEY=A035C8C19219BA821ECEA86B64E628F8…   0B
RUN /bin/sh -c set -eux;  apt-get update;  a…   3.12MB
/bin/sh -c #(nop) ADD file:cb13581b8e7a9de43…   80.6MB   

Ideas on how to reduce size:

  • Copy only gimie folder and accompanying python venv instead of the whole /app folder (check if other dependencies are needed), see example
  • Re-order layers to have Poetry install dependencies first, and then copy gimie. This improves Docker layer caching (see this post, section 4)
  • Remove dev dependencies from installation since they're not necessary to execute gimie (poetry install --without dev arg)

Other ideas are welcome :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions