Uploaded image for project: 'FOLIO'
  1. FOLIO
  2. FOLIO-1544

switch to Alpine to shrink docker containers



    • Template:
    • Sprint:
      CP: ready for planning
    • Development Team:
      Core: Platform


      Currently all java based docker containers except mod-authtoken are based on folioci/openjdk8-jre that is based on Debian stretch. mod-authtoken is based on folioci/openjdk8-jre-alpine that is based on Alpine.
      Containers size comparison (compressed transfer size, not on-disk size):
      186 MB https://hub.docker.com/r/folioci/openjdk8-jre/tags/
      75 MB https://hub.docker.com/r/folioci/openjdk8-jre-alpine/tags/
      The dockerfiles are at https://github.com/folio-org/folio-tools/tree/master/folio-java-docker/openjdk8

      These are the sizes in today's folio/testing vagrant box:

      vagrant@contrib-jessie:~$ docker images --format "table {{.Repository}}\t{{.Tag}}:\t{{.Size}}" | sort -n -k 3
      REPOSITORY                        TAG:                   SIZE
      nginx                             stable-alpine:         17.4MB
      stripes                           latest:                43.4MB
      folioci/mod-authtoken             2.0.2-SNAPSHOT.30:     115MB
      folioci/mod-audit-filter          0.0.2-SNAPSHOT.10:     454MB
      folioci/mod-inventory             9.5.1-SNAPSHOT.104:    459MB
      folioci/mod-circulation           12.0.1-SNAPSHOT.172:   475MB
      folioci/mod-codex-ekb             1.0.1-SNAPSHOT.66:     516MB
      folioci/mod-configuration         5.0.1-SNAPSHOT.47:     516MB
      folioci/mod-feesfines             14.2.5-SNAPSHOT.13:    516MB
      folioci/mod-user-import           3.1.1-SNAPSHOT.31:     516MB
      folioci/mod-calendar              1.0.3-SNAPSHOT.58:     517MB
      folioci/mod-circulation-storage   6.1.1-SNAPSHOT.117:    517MB
      folioci/mod-finance               1.0.1-SNAPSHOT.28:     517MB
      folioci/mod-inventory-storage     12.8.3-SNAPSHOT.164:   517MB
      folioci/mod-login                 4.5.1-SNAPSHOT.23:     517MB
      folioci/mod-orders-storage        1.0.1-SNAPSHOT.14:     517MB
      folioci/mod-password-validator    1.0.1-SNAPSHOT.7:      517MB
      folioci/mod-permissions           5.4.0-SNAPSHOT.31:     517MB
      folioci/mod-rtac                  1.1.1-SNAPSHOT.17:     517MB
      folioci/mod-template-engine       1.0.0-SNAPSHOT.8:      517MB
      folioci/mod-users-bl              4.0.3-SNAPSHOT.30:     517MB
      folioci/mod-vendors               1.0.2-SNAPSHOT.26:     517MB
      folioci/mod-notify                1.2.0-SNAPSHOT.51:     521MB
      folioci/mod-tags                  0.2.0-SNAPSHOT.27:     521MB
      folioci/mod-users                 15.3.0-SNAPSHOT.46:    521MB
      folioci/mod-audit                 0.0.3-SNAPSHOT.15:     522MB
      folioci/mod-codex-inventory       1.3.0-SNAPSHOT.59:     522MB
      folioci/mod-codex-mux             2.2.3-SNAPSHOT.59:     522MB
      folioci/mod-notes                 2.2.0-SNAPSHOT.64:     522MB
      folioci/mod-login-saml            1.2.1-SNAPSHOT.28:     536MB
      folioci/mod-kb-ebsco              1.0.2-SNAPSHOT.154:    848MB
      folioci/mod-graphql               0.1.1000135:           919MB

      Image size reported by docker images:

      module Debian image size Alpine image size Debian image size overhead Debian image size overhead
      mod-inventory 459 MB 90 MB 369 MB 410%
      mod-graphql 1130 MB 304 MB 826 MB 272%
      mod-inventory-storage 507 MB 139 MB 368 MB 265%
      mod-users-bl 507 MB 139 MB 368 MB 265%
      mod-orders-storage 508 MB 140 MB 368 MB 263%

      Mem usage reported by docker stats after starting the docker container:

      module Debian mem Alpine mem Debian mem overhead Debian mem overhead
      mod-orders-storage 340.8 MiB 216.7 MiB 124.1 MiB 57%
      mod-inventory-storage 328.1 MiB 227.1 MiB 101.0 MiB 44%
      mod-users-bl 325.5 MiB 232.4 MiB 93.10 MiB 40%
      mod-inventory 121.9 MiB 94.52 MiB 27.38 MiB 29%
      mod-graphql 223.2 MiB 199.5 MiB 23.70 MiB 12%

      There was some discussion on slack
      that postgresql-embedded doesn't work within Alpine but we probably do not need that because Jenkins runs the unit tests before the docker container is build and the Vagrant boxes run an own Postgres that they provide to the containers.

        TestRail: Results


            Issue Links



                Unassigned Unassigned
                julianladisch Julian Ladisch
                0 Vote for this issue
                5 Start watching this issue



                    TestRail: Runs

                      TestRail: Cases