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
780
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
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
360
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
260
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
180
Androidアプリのモジュール分割における:x:commonを考える
okuzawats
1
260
PHPカンファレンス 2024|共創を加速するための若手の技術挑戦
weddingpark
0
120
情報漏洩させないための設計
kubotak
5
1.2k
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
630
オニオンアーキテクチャを使って、 Unityと.NETでコードを共有する
soi013
0
350
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
290
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
130
Внедряем бюджетирование, или Как сделать хорошо?
lamodatech
0
870
AppRouterを用いた大規模サービス開発におけるディレクトリ構成の変遷と問題点
eiganken
1
410
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
We Have a Design System, Now What?
morganepeng
51
7.3k
The Cost Of JavaScript in 2023
addyosmani
46
7.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Designing Experiences People Love
moore
139
23k
Speed Design
sergeychernyshev
25
720
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.4k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
KATA
mclloyd
29
14k
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ඵ͔͔͔͠Βͳ͍ ▸ Ωϟογϡ͕ແ͍߹ͷϏϧυ࣌ؒͷॖʹΠϝʔδͷܰྔԽޮՌ͕͋Δ