Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
軽量なDockerイメージで CIのビルド時間を短くしてみる
Search
Ryosuke Horie
May 10, 2017
Programming
2
1.4k
軽量なDockerイメージで CIのビルド時間を短くしてみる
https://github.com/horie1024/WerckerAndroidSample
Ryosuke Horie
May 10, 2017
Tweet
Share
More Decks by Ryosuke Horie
See All by Ryosuke Horie
Miro × ZOZO ZOZOのMiro活用事例紹介
horie1024
0
1.2k
GitHub Copilotは開発者の生産性をどれだけ上げるのか?ZOZOでの全社導入とその効果 / How Much Does GitHub Copilot Improve Developer Productivity? The Company-wide Implementation and Its Effects at ZOZO
horie1024
36
24k
ZOZOTOWNにおける開発生産性向上に関する取り組み / Initiatives to Improve Development Productivity at ZOZOTOWN
horie1024
8
6.1k
How does the Relay connect Android app development and Design?
horie1024
2
1.9k
既存画面の Jetpack Composeでの書き換え: FAANSでの事例紹介 / Case study of rewriting existing screens with Jetpack Compose
horie1024
0
1.6k
スキルマップを作った話 / Create a skills map
horie1024
3
4.4k
Miroを使った開発効率向上のための取り組み / Using Miro Efforts to Improve Development Efficiency
horie1024
0
2.4k
ktlintカスタムルールのパッケージ化と再利用/Package and reuse ktlint custom rules
horie1024
1
1.1k
Jetpack Benchmarkでの ViewのInflateパフォーマンスの可視化と改善 / The Jetpack Benchmark. Visualizing and improving View Inflate performance
horie1024
3
1.1k
Other Decks in Programming
See All in Programming
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
590
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
600
ASP.NET Core の OpenAPIサポート
h455h1
0
120
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
180
ドメインイベント増えすぎ問題
h0r15h0
2
570
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.3k
Package Traits
ikesyo
1
210
Scaling your build logic
antalmonori
1
100
ゼロからの、レトロゲームエンジンの作り方
tokujiros
3
1.1k
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
240
AHC041解説
terryu16
0
400
Azure AI Foundryのご紹介
qt_luigi
1
210
Featured
See All Featured
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
500
Building a Scalable Design System with Sketch
lauravandoore
460
33k
A Tale of Four Properties
chriscoyier
157
23k
The Power of CSS Pseudo Elements
geoffreycrofte
74
5.4k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Done Done
chrislema
182
16k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
How to train your dragon (web standard)
notwaldorf
89
5.8k
Speed Design
sergeychernyshev
25
740
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
19
2.3k
A designer walks into a library…
pauljervisheath
205
24k
Music & Morning Musume
bryan
46
6.3k
Transcript
ܰྔͳDockerΠϝʔδͰ CIͷϏϧυ࣌ؒΛͯ͘͠ΈΔ Android Testing Bootcamp #6 Ryosuke Horie VASILY, inc.
ࣗݾհ @Horie1024 ▸ ງߐ ྄հ / Ryosuke Horie ▸ લ৬:
ϙʔλϧαΠτ Web / ΞϓϦ։ൃ ▸ 2લʹVASILYʹத్ೖࣾ ▸ AndroidΤϯδχΞ ▸ ࠷ۙiOSͷϓϩδΣΫτʹࢀՃ ▸ Twitter GitHub Qiita: @Horie1024
ൃද༰ ൃද༰ ▸ DockerʹରԠͨ͠CIαʔϏε͕࠷ۙଟ͍ ▸ CIαʔϏεDockerΠϝʔδΛωοτϫʔΫӽ͠ʹPull ▸ ͦͷͨΊΠϝʔδͷαΠζॏཁ ▸ ΠϝʔδΛܰྔԽ͢Δํ๏Λࢼߦࡨޡ
▸ ϕʔεΠϝʔδΛมߋɺAndroid SDKͷ༰ྔݮ ▸ Pullʹֻ͔Δ࣌ؒॖ -> Ϗϧυ͕࣌ؒ͘ͳΔͷͰʁ
DockerʹରԠͨ͠CIαʔϏε ࠷ۙͷCIαʔϏε ▸ ϏϧυڥΛDockerΠϝʔδͰ༻ҙͰ͖Δ ▸ Wercker ▸ Drone ▸ CircleCI
▸ Travis CI
DockerʹରԠͨ͠CIαʔϏε DockerΠϝʔδͷཧ ▸ ϨδετϦαʔϏεΛར༻ ▸ Docker Hub ▸ Google Container
Registry ▸ Amazon ECR ▸ QUAY.io Amazon ECR
DockerʹରԠͨ͠CIαʔϏε DockerΠϝʔδͷPull ▸ ΠϝʔδΛϨδετϦ͔ΒPull ▸ Ϗϧυ࣌ؒʹؚ·ΕΔ ▸ Πϯλʔωοτܦ༝ ▸ ΠϝʔδͷαΠζΛແࢹͰ͖ͳ͍
Amazon ECR
ΠϝʔδͷܰྔԽ ΠϝʔδαΠζͷݮ ▸ ΠϝʔδΛPull͢Δ࣌ؒͷॖ ▸ Ϗϧυ࣌ؒͷॖʹܨ͕Δ ▸ ͍ܰͷྑ͍
ΠϝʔδͷܰྔԽ Ͳ͏ܰྔԽ͢Δͷ͔ʁ ▸ ܰྔͳOSΛϕʔεΠϝʔδʹ͢Δ ▸ ෆཁͳύοέʔδΛΠϯετʔϧ͠ͳ͍
ΠϝʔδͷܰྔԽ Ͳ͏ܰྔԽ͢Δͷ͔ʁ ▸ ܰྔͳOSΛϕʔεΠϝʔδʹ͢Δ ▸ ෆཁͳύοέʔδΛΠϯετʔϧ͠ͳ͍
ΠϝʔδͷܰྔԽ Alpine Linux ▸ ඇৗʹܰྔͳLinux distribution ▸ ެࣜͷDockerΠϝʔδͰ࠾༻ ▸ Alpine
LinuxΛϕʔεͷΠϝʔδʹ ▸ ΠϝʔδαΠζͷݮʹޮՌେ
Πϝʔδͷ࡞ ૉͷΠϝʔδαΠζൺֱ IMAGE SIZE ubuntu: 16.04 117 MB alpine: 3.5
3.99 MB ▸ ubuntuͱൺֱͯ͠ѹతʹ͍ܰ ▸ ͜ͷαΠζࠩɺΠϝʔδ͕ܰ͘ͳΔͣ
ΠϝʔδͷܰྔԽ 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͕ॏ͗͢Ͱ
ΠϝʔδͷܰྔԽ Docker Hub্Ͱͷൺֱ ▸ Docker HubʹΠϝʔδΛ্͛ͨঢ়ଶ ▸ ѹॖޙͷΠϝʔδαΠζ྆ํ 1 GB
▸ ͋ΕɺαΠζ͕มΘΒͳ͍ɾɾʁ
Ͳ͏͠Α͏
ΠϝʔδͷܰྔԽ WerckerͰPullʹֻ͔Δ࣌ؒͷൺֱ ▸ औΓ͑ͣൺֱ ▸ 5ճฏۉ ▸ WerckerͷΩϟογϡ͕ޮ͍͍ͯͳ͍ঢ়ଶ ▸ alpineϕʔεͷΠϝʔδͷํ͕͍ʂ
IMAGE TIME ubuntu: 16.04 54.2 s alpine: 3.5 46.8 s
ΠϝʔδͷܰྔԽ Ͳ͏ܰྔԽ͢Δͷ͔ʁ ▸ ܰྔͳOSΛϕʔεΠϝʔδʹ͢Δ ▸ ෆཁͳύοέʔδΛΠϯετʔϧ͠ͳ͍
ΠϝʔδͷܰྔԽ Ͳ͏ܰྔԽ͢Δͷ͔ʁ ▸ ܰྔͳOSΛϕʔεΠϝʔδʹ͢Δ ▸ ෆཁͳύοέʔδΛΠϯετʔϧ͠ͳ͍
ΠϝʔδͷܰྔԽ Android SDKͷ༰ྔݮ ▸ ࠷ۙϛχϚϜͳSDK͕μϯϩʔυͰ͖Δ ▸ android-sdk_r24.4.1-linux 570 MB ▸
sdk-tools-linux-3859397 160 MB
ΠϝʔδͷܰྔԽ 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ͷࠩͳͷมΘΒͳ͍
ΠϝʔδͷܰྔԽ WerckerͰPullʹֻ͔Δ࣌ؒͷൺֱ ▸ 5ճฏۉ ▸ ΠϝʔδαΠζͷܰྔԽͰ্ ▸ 10ඵҎ্͘ͳͬͨ IMAGE TIME
ubuntu: 16.04 39.4 s alpine: 3.5 30.2 s
ΠϝʔδͷܰྔԽ Alpine LinuxϕʔεͷΠϝʔδ͕ྑͦ͞͏ ▸ ࠷Πϝʔδ͕ܰྔ ▸ Pullʹֻ͔Δ͍࣌ؒ ▸ ͔͠͠ ▸
AndroidΛϏϧυͰ͖͍ͯͳ͍(5/10 18:00ݱࡏ)
ΠϝʔδͷܰྔԽ Alpine LinuxͰͷቕΓ ▸ sdkmanager͕࣮ߦͰ͖ͳ͍ ▸ Alpine LinuxͰbash͕ೖ͍ͬͯͳ͍ͷ͕ݪҼ ▸ aapt͕࣮ߦͰ͖ͳ͍
▸ Cannot run program "aapt": error=2, No such file or directory ▸ glibc͕ೖ͍ͬͯͳ͍ɻAlpineͰglibcΛೖΕΔͷʹቕ·Δɻ ▸ lib.so.1͕ແ͍ͱౖΒΕΔɻ ▸ aapt32bit൛ͷglibcͰͳ͚ΕͳΒͳ͍ ▸ 32bit൛ͷglibcΛΠϯετʔϧ <- ࠓ͜͜Ͱ ٧·Δ
·ͱΊ
·ͱΊ ▸ DockerΠϝʔδͷܰྔԽେ ▸ ϕʔεΠϝʔδͷมߋɺAndroid SDKͷαΠζݮޮՌత ▸ Alpine Linuxͷߏඞཁ࠷খݶͷͨΊቕ·ΔՄೳੑ͋Γ ▸
DebianɺArch LinuxͰࢼ͢ͱ͋·Γቕ·ΒͣʹܰྔԽͰ͖Δ͔͠Εͳ͍ ▸ ·ͣAndroid SDKͷݮ͔ΒखΛ͚Δͷ͕ྑͦ͞͏ ▸ androidίϚϯυ͕deprecatedʹͳͬͨͷྑ͍ػձ
͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ
appendix ʲิʳWerckerͷΠϝʔδΩϟογϡ ▸ Werckerͷ߹ΠϝʔδͷΩϟογϡΛউखʹͯ͘͠ΕΔ ▸ Ωϟογϡ͕͋Δ߹ΠϝʔδͷPullʹɺ1~2ඵ͔͔͔͠Βͳ͍ ▸ Ωϟογϡ͕ແ͍߹ͷϏϧυ࣌ؒͷॖʹΠϝʔδͷܰྔԽޮՌ͕͋Δ