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
Build your APK beyond Docker #dockerlt
Search
Rize MISUMI
October 14, 2015
Technology
2
2.9k
Build your APK beyond Docker #dockerlt
at Docker 実践 LT
Rize MISUMI
October 14, 2015
Tweet
Share
More Decks by Rize MISUMI
See All by Rize MISUMI
5 Smashing Changes Your Extension Will Encounter #phpblt
misumirize
0
3k
Effective Espresso #roppongi_aar
misumirize
0
2.4k
某イベントを支えるRuby
misumirize
0
970
Being Flux on Electron
misumirize
2
1.3k
Other Decks in Technology
See All in Technology
Webアプリケーションにオブザーバビリティを実装するRust入門ガイド
nwiizo
3
680
[ JAWS-UG 東京 CommunityBuilders Night #2 ]SlackとAmazon Q Developerで 運用効率化を模索する
sh_fk2
2
340
BPaaSにおける人と協働する前提のAIエージェント-AWS登壇資料
kentarofujii
0
130
スマートファクトリーの第一歩 〜AWSマネージドサービスで 実現する予知保全と生成AI活用まで
ganota
1
190
react-callを使ってダイヤログをいろんなとこで再利用しよう!
shinaps
1
220
2025年にHCP Vaultを学び直して見えた景色 / Lessons and New Perspectives from Relearning HCP Vault in 2025
aeonpeople
0
230
2025年夏 コーディングエージェントを統べる者
nwiizo
0
130
AI時代に非連続な成長を実現するエンジニアリング戦略
sansantech
PRO
3
1.2k
テストを軸にした生き残り術
kworkdev
PRO
0
190
OCI Oracle Database Services新機能アップデート(2025/06-2025/08)
oracle4engineer
PRO
0
100
なぜSaaSがMCPサーバーをサービス提供するのか?
sansantech
PRO
8
2.7k
フィンテック養成勉強会#56
finengine
0
140
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
Making Projects Easy
brettharned
117
6.4k
Typedesign – Prime Four
hannesfritz
42
2.8k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Art, The Web, and Tiny UX
lynnandtonic
302
21k
Designing for Performance
lara
610
69k
GraphQLとの向き合い方2022年版
quramy
49
14k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
Visualization
eitanlees
148
16k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Transcript
Build your APK beyond Docker Misumi_Rize / Docker࣮ફLT (Oct. 14,
2015)
Log.d("introduction", me); → Twitter @Misumi_Rize → GitHub @MisumiRize → I'm
not Android APK developer
Software Engineer in Test
Testing strategy 1. Unit tests 2. Instrumentation tests 3. Acceptance
tests 4. Exploratory tests
Testing tools 1. JUnit, Mockito 2. Espresso 3. UIAutomator, Appium
4. Human power
Testing APK is difficult → Developer specific problem → CI
service specific problem → APK's state (SQLite, Preference, etc.)
Container CI
Container as CI Service → Docker as a function (Travis
CI, CircleCI, Wercker) → Based on Docker (Drone)
Docker is protocol
https://hub.docker.com/r/misumirize/android-sdk https://github.com/MisumiRize/dockerfiles/tree/ master/android-sdk
FROM misumirize/android-sdk RUN mkdir /project COPY . /project WORKDIR /project
RUN echo "sdk.dir=$ANDROID_HOME" > local.properties ENTRYPOINT ["./gradlew"] CMD ["tasks"]
Run unit tests and generate APK $ docker build -t
android-build . $ docker run android-build build
How can we automate Activity tests?
Too slow and frustrating ARM emulator cf. Travis CI $
echo no | android create avd --force \ --name test --target android-23 --abi armeabi-v7a $ emulator64-arm -avd test -no-skin -no-audio -no-window & $ android-wait-for-emulator $ adb shell input keyevent 82 & $ ./gradlew connectedCheck
Can we connect to another host (e.g. which real device
is connected) from container?
Problem: → ./gradlew connectedCheck wraps ADB client → We can't
configure the host of ADB client → ADB server binds to the loopback address only
Solution: HAProxy
None
Client (container) frontend local_adb_server bind 127.0.0.1:5037 mode tcp default_backend remote_adb_server
backend remote_adb_server mode tcp server remote01 123.45.67.89:5036 check
Server (devices connected) frontend remote_adb_server bind *:5036 mode tcp default_backend
internal_adb_server backend internal_adb_server mode tcp server internal01 127.0.0.1:5037 check
Separating role is important
https://hub.docker.com/r/misumirize/android- remote-client https://github.com/MisumiRize/dockerfiles/tree/ master/android-remote-client
FROM misumirize/android-remote-client CMD ["connectedAndroidTest", "--stacktrace"]
misumirize/android-remote-client ONBUILD COPY haproxy.cfg /etc/haproxy/haproxy.cfg ONBUILD COPY . /project WORKDIR
/project ONBUILD RUN echo "sdk.dir=$ANDROID_HOME" > local.properties ENTRYPOINT ["execute-remote"]
ONBUILD is awesome!
But a little dirty hack is needed... build.gradle com.android.ddmlib.DdmPreferences.setTimeOut(60000)
Example: Connect Docker (CircleCI) and DigitalOcean Droplet (Android Atom emulator
working)
Example https://github.com/MisumiRize/HackerNews- Android https://circleci.com/gh/MisumiRize/HackerNews- Android/22 → circle.yml → Vagrantfile
Conclusion → Docker is protocol → Separating role (even forcefully)
is important → ONBUILD is useful. Consider using ONBUILD
Thank you!
→ Android Lineup - Shadow by Rob Bulmahn → Desastrosos
by srgpicker → cyclotron by Robert Couse-Baker → Containing the containers by Erik Söderström → Nexus 7 with Android 5 by Yuri Samoilov → IMAG0191 by Robert → Hornby Separated Bike Lane by Paul Krueger → A Street Called Awesome by Selena N. B. H.