SlideShare a Scribd company logo
Android Meets Docker
Jing Li
Developer Story
Pain in the
provision ∞ machines ( e.g. mobile CI )
Admin
Containerization vs Virtualization
Why Docker?
Docker Vagrant
Resource Isolation Low Extreme
Supported OS Linux *
Boot / Stop Time Seconds Minutes
Size MB GB
Docker for Android?
Infer - A tool to detect bugs in Java and ... code.
Run Android SDK update in Docker container
AUFS doesn't support hardlink move operations.
Solution for SDK update
Mount SDK volume in container
• Minimal
• Flexible
• Persist
• Share
NFS
✓ In one place
? Performance
No concurrent writing
Benchmark
Performance Comparison
2 build types, 107 unit tests ( x2 = 214 ), 2 UI tests
./gradlew clean check :demo:connectedAndroidTest
On-premises Docker (w/ cached AndroidSDK) 6 mins 48.0 secs
Other online CI solutions (w/o optimization) > 10 mins
Android Devices
• ARM emulator
• x86 emulator (requires KVM)
• USB (needs privileged mode, ⛔ for macOS)
• Wifi
• Genymotion Cloud
Performance of 📱
2 UI tests
ARM emulator @🐳 2 mins 4.615 secs
x86 emulator @🐳 (on Linux Host) 23.497 secs
Genymotion 25.335 secs
Out Of Memory
Memory Matters
JVM is not container aware
_JAVA_OPTIONS
-XX:+UnlockExperimentalVMOptions
-XX:+UseCGroupMemoryLimitForHeap
Exit Code 137 = 128 + 9 = SIGKILL = Killed 1 = SIGHUP = Hangup
Comment killed by the kernel OOM killer JVM terminates the program and exits
Can we get any better?
Gradle distributions
Gradle distributions mirror server
• From: gradle/wrapper/gradle-wrapper.properties
• To: ~/.gradle/wrapper/dists
• SSL certificate - needs to be trusted by Java keystore
• /etc/hosts
And better?
Gradle caches
• Don’t waste time downloading dependencies
• ~/.gradle/caches/
Reveal
• Encoding problem
expected:<Hall[]chen> but was:<Hall[ö]chen>
• Hard coded Timezone in test
expected: 2099-12-31T00:00:00.0000+0200
but was : 2099-12-31T00:00:00.0000+0000
• File & Path
File#listFiles() -> File[] (sort order depends on OS)
Machine-dependent Problem
What Else for Mobile
• Integration Test
• Prod / Test server
• unreliable network
• complex setup
• Docker
• out of the box for mobile dev
• Something else
• Serverless ( Kotlin, Swift ) - reuse 📱 code
Thank you!
! thyrlian
" thyrlian
Docker Image:
https://github.com/thyrlian/AndroidSDK

More Related Content

PDF
The Fairy Tale of the One Command Build Script
PDF
Docker?!?! But I'm a SysAdmin
PDF
Docker on Docker
PDF
Tales of Training: Scaling CodeLabs with Swarm Mode and Docker-Compose
PDF
Kubernetes in Docker
PDF
Docker on docker leveraging kubernetes in docker ee
PDF
Looking Under The Hood: containerD
PDF
Deploying containers on Heterogeneous IOT devices by Daniel Bruzual
The Fairy Tale of the One Command Build Script
Docker?!?! But I'm a SysAdmin
Docker on Docker
Tales of Training: Scaling CodeLabs with Swarm Mode and Docker-Compose
Kubernetes in Docker
Docker on docker leveraging kubernetes in docker ee
Looking Under The Hood: containerD
Deploying containers on Heterogeneous IOT devices by Daniel Bruzual

What's hot (20)

PDF
Docker for Ops - Scott Coulton, Puppet
PPTX
DockerCon EU 2015: Placing a container on a train at 200mph
PDF
How to accelerate docker adoption with a simple and powerful user experience
PDF
Effective Data Pipelines with Docker & Jenkins - Brian Donaldson
PDF
Skynet vs. Planet of The Apes: Duel!
PDF
Production sec ops with kubernetes in docker
PDF
Modernizing .NET Apps
PDF
It takes a Village to do the Impossible - Jeff Lindsay
PDF
DCEU 18: Docker Containers in a Serverless World
PDF
Docker Enterprise Edition: Building a Secure Supply Chain for the Enterprise ...
PDF
Node.js Rocks in Docker for Dev and Ops
PDF
Automated hardware testing using docker for space
PDF
Gordon's secret session kubernetes on windows
PDF
How Docker EE Helps Open Doors at Assa Abloy
PPTX
Introducing LinuxKit
PPTX
Docker Platform 1.9
PDF
Packaging software for the distribution on the edge
PDF
A vision of persistence
PDF
Advanced Access Control with Docker EE
PDF
Online Meetup: What's new in docker 1.13.0
Docker for Ops - Scott Coulton, Puppet
DockerCon EU 2015: Placing a container on a train at 200mph
How to accelerate docker adoption with a simple and powerful user experience
Effective Data Pipelines with Docker & Jenkins - Brian Donaldson
Skynet vs. Planet of The Apes: Duel!
Production sec ops with kubernetes in docker
Modernizing .NET Apps
It takes a Village to do the Impossible - Jeff Lindsay
DCEU 18: Docker Containers in a Serverless World
Docker Enterprise Edition: Building a Secure Supply Chain for the Enterprise ...
Node.js Rocks in Docker for Dev and Ops
Automated hardware testing using docker for space
Gordon's secret session kubernetes on windows
How Docker EE Helps Open Doors at Assa Abloy
Introducing LinuxKit
Docker Platform 1.9
Packaging software for the distribution on the edge
A vision of persistence
Advanced Access Control with Docker EE
Online Meetup: What's new in docker 1.13.0
Ad

Viewers also liked (17)

PDF
Repainting the Past with Distributed Machine Learning and Docker
PDF
Cilium: Kernel Native Security & DDOS Mitigation for Microservices with BPF
PDF
Docker to the Rescue of an Ops Team
PDF
Containerizing Hardware Accelerated Applications
PDF
Experience the Swarm API in Virtual Reality
PDF
Continuous Packaging is also Mandatory for DevOps
PDF
The Truth Behind Serverless
PDF
My Journey To Go
PDF
LinuxKit Deep Dive
PDF
Moby and Kubernetes entitlements
PDF
How and Why Prometheus' New Storage Engine Pushes the Limits of Time Series D...
PDF
The Value Of Diverse Experiences
PDF
Taking Docker to Production: What You Need to Know and Decide
PDF
What's New in Docker
PDF
Learning Docker from Square One
PPTX
Introduction to Docker - 2017
PDF
Integrating Docker EE into Société Générale's Existing Enterprise IT Systems
Repainting the Past with Distributed Machine Learning and Docker
Cilium: Kernel Native Security & DDOS Mitigation for Microservices with BPF
Docker to the Rescue of an Ops Team
Containerizing Hardware Accelerated Applications
Experience the Swarm API in Virtual Reality
Continuous Packaging is also Mandatory for DevOps
The Truth Behind Serverless
My Journey To Go
LinuxKit Deep Dive
Moby and Kubernetes entitlements
How and Why Prometheus' New Storage Engine Pushes the Limits of Time Series D...
The Value Of Diverse Experiences
Taking Docker to Production: What You Need to Know and Decide
What's New in Docker
Learning Docker from Square One
Introduction to Docker - 2017
Integrating Docker EE into Société Générale's Existing Enterprise IT Systems
Ad

Similar to Android Meets Docker (20)

PDF
До чого прикладати Docker в Android? - UA Mobile 2019
PDF
Head first android apps dev tools
PDF
LinkedIn's Consistent Android Testing Environments Using Gradle
PDF
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
PDF
Java and Containers - Make it Awesome !
PDF
DCSF19 Docker Containers & Java: What I Wish I Had Been Told
PDF
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
PPTX
Michal Kordas "Docker: Good, Bad or Both"
PDF
LMG Lightning Talks - SFO17-205
PDF
Gradle-based Android Build System
PPTX
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
PDF
Scala, docker and testing, oh my! mario camou
PDF
Testing fácil con Docker: Gestiona dependencias y unifica entornos
PDF
Docker introduction in Hardware Company
PDF
Using containers for continuous integration and continuous delivery - Carlos ...
PDF
Using Containers for Continuous Integration and Continuous Delivery
PPTX
Настройка окружения для кросскомпиляции проектов на основе docker'a
PDF
Apt get no more let Vagrant, Puppet and Docker take the stage
PDF
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
PPTX
Docker for everything
До чого прикладати Docker в Android? - UA Mobile 2019
Head first android apps dev tools
LinkedIn's Consistent Android Testing Environments Using Gradle
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
Java and Containers - Make it Awesome !
DCSF19 Docker Containers & Java: What I Wish I Had Been Told
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Michal Kordas "Docker: Good, Bad or Both"
LMG Lightning Talks - SFO17-205
Gradle-based Android Build System
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
Scala, docker and testing, oh my! mario camou
Testing fácil con Docker: Gestiona dependencias y unifica entornos
Docker introduction in Hardware Company
Using containers for continuous integration and continuous delivery - Carlos ...
Using Containers for Continuous Integration and Continuous Delivery
Настройка окружения для кросскомпиляции проектов на основе docker'a
Apt get no more let Vagrant, Puppet and Docker take the stage
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
Docker for everything

More from Docker, Inc. (20)

PDF
Containerize Your Game Server for the Best Multiplayer Experience
PDF
How to Improve Your Image Builds Using Advance Docker Build
PDF
Build & Deploy Multi-Container Applications to AWS
PDF
Securing Your Containerized Applications with NGINX
PDF
How To Build and Run Node Apps with Docker and Compose
PDF
Hands-on Helm
PDF
Distributed Deep Learning with Docker at Salesforce
PDF
The First 10M Pulls: Building The Official Curl Image for Docker Hub
PDF
Monitoring in a Microservices World
PDF
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
PDF
Predicting Space Weather with Docker
PDF
Become a Docker Power User With Microsoft Visual Studio Code
PDF
How to Use Mirroring and Caching to Optimize your Container Registry
PDF
Monolithic to Microservices + Docker = SDLC on Steroids!
PDF
Kubernetes at Datadog Scale
PDF
Labels, Labels, Labels
PDF
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
PDF
Build & Deploy Multi-Container Applications to AWS
PDF
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
PDF
Developing with Docker for the Arm Architecture
Containerize Your Game Server for the Best Multiplayer Experience
How to Improve Your Image Builds Using Advance Docker Build
Build & Deploy Multi-Container Applications to AWS
Securing Your Containerized Applications with NGINX
How To Build and Run Node Apps with Docker and Compose
Hands-on Helm
Distributed Deep Learning with Docker at Salesforce
The First 10M Pulls: Building The Official Curl Image for Docker Hub
Monitoring in a Microservices World
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
Predicting Space Weather with Docker
Become a Docker Power User With Microsoft Visual Studio Code
How to Use Mirroring and Caching to Optimize your Container Registry
Monolithic to Microservices + Docker = SDLC on Steroids!
Kubernetes at Datadog Scale
Labels, Labels, Labels
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Build & Deploy Multi-Container Applications to AWS
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
Developing with Docker for the Arm Architecture

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Big Data Technologies - Introduction.pptx
PDF
Modernizing your data center with Dell and AMD
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
KodekX | Application Modernization Development
Understanding_Digital_Forensics_Presentation.pptx
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
MYSQL Presentation for SQL database connectivity
Dropbox Q2 2025 Financial Results & Investor Presentation
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
NewMind AI Monthly Chronicles - July 2025
NewMind AI Weekly Chronicles - August'25 Week I
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
The AUB Centre for AI in Media Proposal.docx
Reach Out and Touch Someone: Haptics and Empathic Computing
Big Data Technologies - Introduction.pptx
Modernizing your data center with Dell and AMD
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Spectral efficient network and resource selection model in 5G networks
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Digital-Transformation-Roadmap-for-Companies.pptx
Unlocking AI with Model Context Protocol (MCP)
KodekX | Application Modernization Development

Android Meets Docker

  • 3. Pain in the provision ∞ machines ( e.g. mobile CI ) Admin
  • 5. Why Docker? Docker Vagrant Resource Isolation Low Extreme Supported OS Linux * Boot / Stop Time Seconds Minutes Size MB GB
  • 6. Docker for Android? Infer - A tool to detect bugs in Java and ... code. Run Android SDK update in Docker container AUFS doesn't support hardlink move operations.
  • 7. Solution for SDK update Mount SDK volume in container • Minimal • Flexible • Persist • Share
  • 8. NFS ✓ In one place ? Performance No concurrent writing
  • 10. Performance Comparison 2 build types, 107 unit tests ( x2 = 214 ), 2 UI tests ./gradlew clean check :demo:connectedAndroidTest On-premises Docker (w/ cached AndroidSDK) 6 mins 48.0 secs Other online CI solutions (w/o optimization) > 10 mins
  • 11. Android Devices • ARM emulator • x86 emulator (requires KVM) • USB (needs privileged mode, ⛔ for macOS) • Wifi • Genymotion Cloud
  • 12. Performance of 📱 2 UI tests ARM emulator @🐳 2 mins 4.615 secs x86 emulator @🐳 (on Linux Host) 23.497 secs Genymotion 25.335 secs
  • 14. Memory Matters JVM is not container aware _JAVA_OPTIONS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap Exit Code 137 = 128 + 9 = SIGKILL = Killed 1 = SIGHUP = Hangup Comment killed by the kernel OOM killer JVM terminates the program and exits
  • 15. Can we get any better? Gradle distributions
  • 16. Gradle distributions mirror server • From: gradle/wrapper/gradle-wrapper.properties • To: ~/.gradle/wrapper/dists • SSL certificate - needs to be trusted by Java keystore • /etc/hosts
  • 17. And better? Gradle caches • Don’t waste time downloading dependencies • ~/.gradle/caches/
  • 18. Reveal • Encoding problem expected:<Hall[]chen> but was:<Hall[ö]chen> • Hard coded Timezone in test expected: 2099-12-31T00:00:00.0000+0200 but was : 2099-12-31T00:00:00.0000+0000 • File & Path File#listFiles() -> File[] (sort order depends on OS) Machine-dependent Problem
  • 19. What Else for Mobile • Integration Test • Prod / Test server • unreliable network • complex setup • Docker • out of the box for mobile dev • Something else • Serverless ( Kotlin, Swift ) - reuse 📱 code
  • 20. Thank you! ! thyrlian " thyrlian Docker Image: https://github.com/thyrlian/AndroidSDK