Upgrade to Pro — share decks privately, control downloads, hide ads and more …

軽量なDockerイメージで
CIのビルド時間を短くしてみる

 軽量なDockerイメージで
CIのビルド時間を短くしてみる

Ryosuke Horie

May 10, 2017
Tweet

More Decks by Ryosuke Horie

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ @Horie1024 ▸ ງߐ ྄հ / Ryosuke Horie ▸ લ৬:

    ϙʔλϧαΠτ Web / ΞϓϦ։ൃ ▸ 2೥લʹVASILYʹத్ೖࣾ ▸ AndroidΤϯδχΞ ▸ ࠷ۙ͸iOSͷϓϩδΣΫτʹࢀՃ ▸ Twitter GitHub Qiita: @Horie1024
  2. Πϝʔδͷ࡞੒ ૉͷΠϝʔδαΠζൺֱ IMAGE SIZE ubuntu: 16.04 117 MB alpine: 3.5

    3.99 MB ▸ ubuntuͱൺֱͯ͠ѹ౗తʹ͍ܰ ▸ ͜ͷαΠζࠩ෼ɺΠϝʔδ͕ܰ͘ͳΔ͸ͣ
  3. ΠϝʔδͷܰྔԽ Android SDKΛμ΢ϯϩʔυͨ͠ঢ়ଶ IMAGE SIZE ubuntu: 16.04 2.05 GB alpine:

    3.5 1.58 GB ▸ android-sdk_r24.4.1-linux͕ϕʔε ▸ android sdk update ▸ android-25, build-tools-25.0.3 ▸ extra-google-m2repository ▸ extra-android-m2repository ▸ ໿500 MBͷࠩ ▸ ͦ΋ͦ΋Android SDK͕ॏ͗͢Ͱ͸
  4. ΠϝʔδͷܰྔԽ Android SDKΛμ΢ϯϩʔυͨ͠ঢ়ଶ IMAGE SIZE ubuntu: 16.04 1.53 GB alpine:

    3.5 1.04 GB ▸ sdk-tools-linux-3859397͕ϕʔε ▸ androidίϚϯυ͕deprecated ▸ sdkmanagerΛ࢖༻ ▸ android-25, build-tools-25.0.3 ▸ extra-google-m2repository ▸ extra-android-m2repository ▸ ໿500 MBͷࠩͳͷ͸มΘΒͳ͍
  5. ΠϝʔδͷܰྔԽ Alpine LinuxͰͷቕΓ ▸ sdkmanager͕࣮ߦͰ͖ͳ͍ ▸ Alpine LinuxͰ͸bash͕ೖ͍ͬͯͳ͍ͷ͕ݪҼ ▸ aapt͕࣮ߦͰ͖ͳ͍

    ▸ Cannot run program "aapt": error=2, No such file or directory ▸ glibc͕ೖ͍ͬͯͳ͍ɻAlpineͰglibcΛೖΕΔͷʹቕ·Δɻ ▸ lib.so.1͕ແ͍ͱౖΒΕΔɻ ▸ aapt͸32bit൛ͷglibcͰͳ͚Ε͹ͳΒͳ͍ ▸ 32bit൛ͷglibcΛΠϯετʔϧ <- ࠓ͜͜Ͱ ٧·Δ
  6. ·ͱΊ ▸ DockerΠϝʔδͷܰྔԽ͸େ੾ ▸ ϕʔεΠϝʔδͷมߋɺAndroid SDKͷαΠζ࡟ݮ͸ޮՌత ▸ Alpine Linuxͷߏ੒͸ඞཁ࠷খݶͷͨΊቕ·ΔՄೳੑ͋Γ ▸

    DebianɺArch LinuxͰࢼ͢ͱ͋·Γቕ·ΒͣʹܰྔԽͰ͖Δ͔΋͠Εͳ͍ ▸ ·ͣ͸Android SDKͷ࡟ݮ͔ΒखΛ෇͚Δͷ͕ྑͦ͞͏ ▸ androidίϚϯυ͕deprecatedʹͳͬͨͷ΋ྑ͍ػձ