android-build-environment icon indicating copy to clipboard operation
android-build-environment copied to clipboard

Optimize image, reduce docker image size by 11GB

Open thomasnordquist opened this issue 8 years ago • 3 comments

The changes only consist of structural changes, the build environment itself has not been altered.

What has been achieved by the changes:

  • much faster build time from 33min to 5.5min (600% faster) (build-time depends on network and IO perfomance)
  • reduces image size from 16.1GB to 5.14GB (>300% smaller)
  • reduces image layers from 52 to 36

Clear /var/lib/apt/lists/ in the same layer apt-get update was invoked: https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#run

Optimize for image size: https://blog.replicated.com/engineering/refactoring-a-dockerfile-for-image-size/

screenshot

thomasnordquist avatar Mar 14 '17 12:03 thomasnordquist

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 14 '17 12:03 CLAassistant

travis failed since docker was run with --quiet=true. It also ran much longer then expected. (Slow CI server ?)

travis_time:start:230c3218
[0K$ docker build --quiet=true -t uber/android-build-environment .


No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received

The build has been terminated

thomasnordquist avatar Mar 14 '17 12:03 thomasnordquist

This seems like an great improvement. Any chance this will be merged?

ottob avatar Aug 18 '17 14:08 ottob