├── .github ├── dependabot.yml └── workflows │ └── docker.yml ├── Dockerfile ├── LICENSE └── README.md /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | open-pull-requests-limit: 1 8 | - package-ecosystem: "docker" 9 | directory: "/" 10 | schedule: 11 | interval: "daily" 12 | open-pull-requests-limit: 1 -------------------------------------------------------------------------------- /.github/workflows/docker.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image 2 | 3 | on: 4 | schedule: 5 | - cron: "0 13 * * *" # everyday at 1pm 6 | push: 7 | branches: ["**"] 8 | tags: ["v*.*.*"] 9 | 10 | env: 11 | platforms: linux/amd64 12 | 13 | jobs: 14 | main: 15 | runs-on: ubuntu-22.04 16 | timeout-minutes: 20 17 | steps: 18 | - name: Check out the repo 19 | uses: actions/checkout@v4 20 | - name: Set imageName based on the repository name 21 | id: step_one 22 | run: | 23 | imageName="${GITHUB_REPOSITORY/docker-/}" 24 | echo $imageName 25 | echo "imageName=$imageName" >> $GITHUB_ENV 26 | - name: Docker meta 27 | id: docker_meta 28 | uses: crazy-max/ghaction-docker-meta@v5 29 | with: 30 | images: ${{ env.imageName }} 31 | - name: Set up QEMU 32 | uses: docker/setup-qemu-action@v3 33 | - name: Set up Docker Buildx 34 | uses: docker/setup-buildx-action@v3 35 | - name: Login to Harbor 36 | uses: docker/login-action@v3 37 | with: 38 | username: ${{ secrets.DOCKERHUB_USERNAME }} 39 | password: ${{ secrets.DOCKERHUB_TOKEN }} 40 | - name: Buildx cache 41 | uses: actions/cache@v4 42 | with: 43 | path: ${{ github.workspace }}/cache 44 | key: ${{ runner.os }}-docker-${{ hashfiles('cache/**') }} 45 | restore-keys: | 46 | ${{ runner.os }}-docker 47 | - name: Build and push 48 | id: docker_build 49 | uses: docker/build-push-action@v6 50 | with: 51 | platforms: ${{ env.platforms }} 52 | push: ${{ github.event_name != 'pull_request' }} 53 | tags: ${{ steps.docker_meta.outputs.tags }} 54 | labels: ${{ steps.docker_meta.outputs.labels }} 55 | # cache-from: type=local,src=${{ github.workspace }}/cache 56 | # cache-to: type=local,dest=${{ github.workspace }}/cache 57 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM beevelop/java 2 | 3 | # https://developer.android.com/studio/#downloads 4 | ENV ANDROID_SDK_URL="https://dl.google.com/android/repository/commandlinetools-linux-10406996_latest.zip" \ 5 | ANDROID_BUILD_TOOLS_VERSION=34.0.0 \ 6 | ANT_HOME="/usr/share/ant" \ 7 | MAVEN_HOME="/usr/share/maven" \ 8 | GRADLE_HOME="/usr/share/gradle" \ 9 | ANDROID_SDK_ROOT="/opt/android" \ 10 | ANDROID_HOME="/opt/android" 11 | 12 | ENV PATH $PATH:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$ANT_HOME/bin:$MAVEN_HOME/bin:$GRADLE_HOME/bin 13 | 14 | WORKDIR /opt 15 | 16 | RUN apt-get -qq update && \ 17 | apt-get -qq install -y wget curl maven ant gradle 18 | 19 | # Installs Android SDK 20 | RUN mkdir android && cd android && \ 21 | wget -O tools.zip ${ANDROID_SDK_URL} && \ 22 | unzip tools.zip && rm tools.zip && \ 23 | cd cmdline-tools && \ 24 | mkdir latest && \ 25 | ls | grep -v latest | xargs mv -t latest 26 | 27 | RUN mkdir /root/.android && touch /root/.android/repositories.cfg && \ 28 | while true; do echo 'y'; sleep 2; done | sdkmanager "platform-tools" "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" && \ 29 | while true; do echo 'y'; sleep 2; done | sdkmanager "platforms;android-28" "platforms;android-29" "platforms;android-30" && \ 30 | while true; do echo 'y'; sleep 2; done | sdkmanager "platforms;android-31" "platforms;android-32" "platforms;android-33" "platforms;android-34" && \ 31 | while true; do echo 'y'; sleep 2; done | sdkmanager "extras;android;m2repository" "extras;google;google_play_services" "extras;google;instantapps" "extras;google;m2repository" && \ 32 | while true; do echo 'y'; sleep 2; done | sdkmanager "add-ons;addon-google_apis-google-22" "add-ons;addon-google_apis-google-23" "add-ons;addon-google_apis-google-24" "skiaparser;1" "skiaparser;2" "skiaparser;3" 33 | 34 | RUN chmod a+x -R $ANDROID_SDK_ROOT && \ 35 | chown -R root:root $ANDROID_SDK_ROOT && \ 36 | rm -rf /opt/android/licenses && \ 37 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ 38 | apt-get autoremove -y && \ 39 | apt-get clean && \ 40 | mvn -v && gradle -v && java -version && ant -version 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2015-2023 Maik Hummel 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/beevelop/docker-android/docker.yml?style=for-the-badge) 2 | ![Docker Pulls](https://img.shields.io/docker/pulls/beevelop/android.svg?style=for-the-badge) 3 | ![Docker Stars](https://img.shields.io/docker/stars/beevelop/android?style=for-the-badge) 4 | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/beevelop/android/latest?style=for-the-badge) 5 | ![License](https://img.shields.io/github/license/beevelop/docker-android?style=for-the-badge) 6 | [![GitHub release](https://img.shields.io/github/release/beevelop/docker-android.svg?style=for-the-badge)](https://github.com/beevelop/docker-android/releases) 7 | ![GitHub Release Date](https://img.shields.io/github/release-date/beevelop/docker-android?style=for-the-badge) 8 | ![CalVer](https://img.shields.io/badge/CalVer-YYYY.MM.MICRO-22bfda.svg?style=for-the-badge) 9 | [![Beevelop](https://img.shields.io/badge/-%20Made%20with%20%F0%9F%8D%AF%20by%20%F0%9F%90%9Dvelop-blue.svg?style=for-the-badge)](https://beevelop.com) 10 | 11 | # Android 13 (API levels 28 - 34) 12 | 13 | ## based on [beevelop/java](https://github.com/beevelop/docker-java) 14 | 15 | - Java `17.0.9` 16 | - Gradle `4.4.1` (Groovy: `2.4.21`) 17 | - Apache Maven `3.6.3` 18 | - Ant `1.10.12` 19 | 20 | ## Pull, build or run this image 21 | 22 | ```bash 23 | # pull the most recent tag / release 24 | docker pull beevelop/android:v2023.12.1 25 | 26 | # or run the image interactively 27 | docker run --rm --name beevelop -it beevelop/android:v2023.12.1 bash 28 | 29 | # or build the image from GitHub 30 | docker build -t beevelop/android github.com/beevelop/docker-base 31 | ``` 32 | 33 | ## Or use it as a base image 34 | 35 | ```Dockerfile 36 | FROM beevelop/android:v2023.12.1 37 | 38 | # accepts all the Licenses (please read first) 39 | RUN yes | sdkmanager --licenses --sdk_root=$ANDROID_SDK_ROOT 40 | ``` 41 | 42 | ## Licenses 43 | 44 | The usage of the Android SDK requires you to accept the licenses 45 | 46 | ## Maintenance 47 | 48 | - [Command Line Tools Download](https://developer.android.com/studio#span-idcommand-toolsa-namecmdline-toolsacommand-line-tools-onlyspan) 49 | - List build-tools versions: `sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --list | grep build-tools` 50 | - [SDK Build Tools release notes](https://developer.android.com/tools/releases/build-tools) 51 | - List platforms: `sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --list | grep 'platforms:'` 52 | 53 | --- 54 | 55 | ![Beevelop's Docker Image Hierarchy](https://gist.githubusercontent.com/beevelop/b0cddab7209a683c77560d06ff00bc8e/raw/15429ee1d02e2c4dc019b760ca8c7ceff5911b82/hierarchy.png) 56 | 57 | ### Use tags where possible, because 58 | 59 | ![One does not simply use latest](https://i.imgflip.com/1fgwxr.jpg) 60 | --------------------------------------------------------------------------------