Public | Automated Build

Last pushed: 6 days ago
Short Description
This docker is to build Android Gradle project with Java 7.
Full Description

android-java7

DEPRECATED use java7-8

This docker is to build Android Gradle project with Java 7.
It is available on Docker Hub https://registry.hub.docker.com/u/jacekmarchwicki/android/ .

Contains:

  • Android SDK: r24.3.3
  • Build tools: 21, 21.0.1, 21.0.2, 21.1, 21.1.1, 21.1.2, 22, 22.0.1
  • Android API: 21, 22
  • Support maven repository
  • Google maven repository
  • Arm emulator: v21
  • Platform tools
  • Created emulator image named: "Nexus 5"

Build image

docker build -t jacekmarchwicki/android .

If building fail you can debug via where 1b372b1f76f2 is partial build

docker run --tty --interactive --rm 1b372b1f76f2 /bin/bash

Push build version to repository

docker push jacekmarchwicki/android:java7

Usage

Change directory to your project directory, than run:

docker run --tty --interactive --volume=$(pwd):/opt/workspace --workdir=/opt/workspace --rm jacekmarchwicki/android:java7  /bin/sh -c "./gradlew build"
Docker Pull Command
Owner
jacekmarchwicki
Source Repository

Comments (9)
shashiwenable
2 months ago

Can you point me how to create my own image with my Build Env. Would like to create my own env.

jacekmarchwicki
3 months ago

For any issues please look on github

pubemail
3 months ago

How can I run this container on a no-gui machine, and connect it via sth like VNC?

rulee
9 months ago

I'm using this image for Gitlab CI build. That console output tells me: "failed to find target with hash string 'android-23' in: /opt/android-sdk-linux".

But according to the description, this version should be included?
Same counts for Build tools 23.0.3

jacekmarchwicki
2 years ago

@thaniyarasu you probably need to put --no-ui to your command

in some dockers on ci we install some application additionally via:
/opt/tools/android-accept-licenses.sh "android update sdk --all --no-ui --filter \"build-tools-22.0.0, extra-android-support, extra-android-m2repository, extra-google-google_play_services, extra-google-m2repository\"

thaniyarasu
2 years ago

if you do "android update" inside docker file then it will raise that error.
but if you run the same "android update" inside docker live container then it won't raise error.

jacekmarchwicki
2 years ago

This issue "Filed to rename directory" is related to https://github.com/travis-ci/travis-ci/issues/2848.
Actually I do not recall but on one of docker file system this might happen afs or bfs.
But you have everything installed on this docker so you do not have to update sdk.
If you would like to have more tools just create a fork and push new build to docker hub so you will not install tool in each build.

thaniyarasu
2 years ago

getting the same error
Failed to rename directory /opt/android-sdk-linux/tools to /usr/local/android-sdk-linux/temp/ToolPackage.old01.
Failed to create directory /opt/android-sdk-linux/tools

kargs
2 years ago

When installing tools following happens:
Failed to rename directory /opt/android-sdk-linux/tools to /opt/android-sdk-linux/temp/ToolPackage.old01. Failed to create directory /opt/android-sdk-linux/tools