Build an Android app with Docker: build, push and pull docker image.

Andres Sandoval
5 min readMar 16, 2018

Check out this tutorial to get started with Docker:

The main file on Docker is Dockerfile. Docker is like a virtual machine running locally, similar to python virtual environments. Tutorial below shows how to build an Android application with Docker.

This is useful in CI process. Before I used to build with a Mac Machine used only for building, the problem with this is that you need to spend time doing maintenance to update: MacOS, android studio +, emulator, .., virus update, etc. Docker fixes all those problems since it takes care of the middleware. Using an Android Dockerfile installs Android components, sdk, gradle, and after that, we can build our Android App, test, jacoco report, lint, etc. Docker runs on EC2 AWS.

Build Android image

  1. Create a new directory. $mkdir LearningDocker
  2. $cd LearningDocker. Create new file name: Dockerfile
  3. $vi Dockerfile. Copy and paste below snippet
FROM gradle:4.10.0-jdk8USER rootENV SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip" \…

--

--

Responses (4)