Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/versions.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
IMAGE_VERSION=1.21.16
NDK_VERSION=27.2.12479018
BAZELISK_VERSION=v1.26.0
IMAGE_VERSION=1.22.1
NDK_VERSION=29.0.14206865
BAZELISK_VERSION=v1.27.0
36 changes: 34 additions & 2 deletions .github/workflows/post_merge_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,37 @@ jobs:
envFilePath: .github/versions.env
- run: ./.github/docker_build_image.sh
- run: ./.github/docker_push_image.sh
build_dev_image:
build_dev_base_image:
runs-on: ubuntu-24.04
needs:
- build_specialized_images
env:
IMAGE_NAME: android_dev_base
DOCKER_FILE_PATH: android_dev_base/.
SQUASH_IMAGE: NO
steps:
- uses: actions/checkout@v3.5.0
- name: Log in to Docker Hub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Log in to the Container registry
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set versions
uses: tw3lveparsecs/github-actions-set-variables@latest
with:
envFilePath: .github/versions.env
- run: ./.github/docker_build_image.sh
- run: ./.github/docker_push_image.sh
build_dev_image:
runs-on: ubuntu-24.04
needs:
- build_dev_base_image
env:
IMAGE_NAME: android_dev
DOCKER_FILE_PATH: android_dev/.
Expand Down Expand Up @@ -143,7 +170,12 @@ jobs:
docker pull ghcr.io/menny/android_bazel:${{ env.IMAGE_VERSION }}
```
<br/>
**Dev**: Bazel + node, pnpm, zsh, oh-my-zsh, and gemini-cli ([Dockerfile](https://github.com/menny/docker_android/blob/${{ env.IMAGE_VERSION }}/android_dev/Dockerfile)):<br/>
**Dev-Base**: Bazel + node, pnpm, zsh, Claude-Code, and gemini-cli ([Dockerfile](https://github.com/menny/docker_android/blob/${{ env.IMAGE_VERSION }}/android_dev_base/Dockerfile)):<br/>
```
docker pull ghcr.io/menny/android_dev_base:${{ env.IMAGE_VERSION }}
```
<br/>
**Dev**: android_dev_base + oh-my-zsh + sshd + some scripts ([Dockerfile](https://github.com/menny/docker_android/blob/${{ env.IMAGE_VERSION }}/android_dev/Dockerfile)):<br/>
```
docker pull ghcr.io/menny/android_dev:${{ env.IMAGE_VERSION }}
```
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre_merge_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
run: IMAGE_NAME="android" DOCKER_FILE_PATH="." ./.github/docker_build_image.sh
- name: Android image with Bazel tools
run: IMAGE_NAME="android_bazel" DOCKER_FILE_PATH="android_bazel/." ./.github/docker_build_image.sh
- name: Android image for personal dev
run: IMAGE_NAME="android_dev" DOCKER_FILE_PATH="android_dev/." ./.github/docker_build_image.sh
- name: Android image for personal dev (base)
run: IMAGE_NAME="android_dev_base" DOCKER_FILE_PATH="android_dev_base/." ./.github/docker_build_image.sh
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ LABEL version="${IMAGE_VERSION}"
LABEL maintainer="menny@evendanan.net"

# Install sdk elements (list from "sdkmanager --list")
RUN sdkmanager "build-tools;35.0.0"
RUN sdkmanager "build-tools;36.1.0"

RUN sdkmanager "platforms;android-35"
RUN sdkmanager "platforms;android-36"

#accepting licenses
RUN yes | sdkmanager --licenses
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ These images are available in Docker Hub and [ghcr.io](https://github.com/menny?

## Contains:

* Based on `ubuntu:jammy` 24.04
* Based on `ubuntu:plucky` 25.04
* with wget, curl, zip, python, pip, git, make, gcc (and other build-essential)
* Corretto JDK17 - https://github.com/corretto/corretto-17/releases
* cmdline tools 16.0
* Platform tools 35.0.0
* Build Tools 35.0.0
* SDK API 35
* Corretto JDK21 - https://github.com/corretto/corretto-21/releases
* cmdline tools 19.0
* Platform tools 36.1.0
* Build Tools 36.1.0
* SDK API 36
* Compressed and squashed into one layer (where makes sense).


Expand Down
13 changes: 6 additions & 7 deletions android_base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:jammy@sha256:f470988096c4d77efac9740a1b6700823681af518a17fad30111430b95dfbffa
FROM ubuntu:plucky@sha256:34e8533bf27ac50f60bec267f6ce18c9aeb9556574e1ec1a8ce89926d32ea8f3
ARG IMAGE_VERSION

LABEL description="A general use Android docker for CI"
Expand All @@ -12,14 +12,13 @@ ENV TERM=dumb
# Install Deps and build-essential
RUN apt-get update \
&& apt-get install -y --allow-remove-essential --allow-change-held-packages --no-install-recommends \
locales software-properties-common ca-certificates build-essential zlib1g-dev \
locales ca-certificates build-essential zlib1g-dev \
pkg-config file \
python3 python3-pip python3-lxml python3-yaml libxml2-utils yamllint \
wget curl nano rsync zip psmisc rsyslog jq unzip \
imagemagick librsvg2-bin \
java-common \
&& add-apt-repository ppa:git-core/ppa -y \
&& apt-get install git -y --allow-remove-essential --allow-change-held-packages --no-install-recommends \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -40,14 +39,14 @@ ENV ANDROID_HOME=/opt/android-sdk-linux
ENV PATH=${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools

# Setup Java
RUN curl https://corretto.aws/downloads/resources/17.0.10.8.1/java-17-amazon-corretto-jdk_17.0.10.8-1_amd64.deb -o jdk-corretto.deb \
RUN curl -L https://corretto.aws/downloads/latest/amazon-corretto-21-x64-linux-jdk.deb -o jdk-corretto.deb \
&& dpkg --install jdk-corretto.deb \
&& rm jdk-corretto.deb

RUN java -version

# Install Android SDK
RUN curl https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -o downloaded_sdk.zip \
RUN curl -L https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip -o downloaded_sdk.zip \
&& mkdir -p /opt/android-sdk-linux/cmdline-tools \
&& unzip downloaded_sdk.zip -d /opt/android-sdk-linux/cmdline-tools \
&& rm -f downloaded_sdk.zip \
Expand All @@ -59,7 +58,7 @@ RUN yes | sdkmanager --licenses
# Install sdk elements (list from "sdkmanager --list")
RUN sdkmanager --list

RUN sdkmanager "cmdline-tools;16.0"
RUN sdkmanager "cmdline-tools;19.0"
RUN sdkmanager "platform-tools"

#accepting licenses
Expand Down
3 changes: 2 additions & 1 deletion android_base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ My general usage (very up-to-date) Docker image for Android CI. Without anything

* Based on `ubuntu:jammy` 22.04
* with wget, curl, zip, python, python3, pip, rsyslog, git, make, gcc (and other build-essential)
* Corretto JDK17 - https://github.com/corretto/corretto-17/releases
* Corretto JDK 21 - https://github.com/corretto/corretto-21/releases
* Android Command Line Tools 19.0
* Compressed and squashed into one layer.

## Accepting licenses
Expand Down
36 changes: 3 additions & 33 deletions android_dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,47 +1,17 @@
ARG IMAGE_VERSION
FROM menny/android_bazel:${IMAGE_VERSION}
FROM menny/android_dev_base:${IMAGE_VERSION}

ARG IMAGE_VERSION
ARG GEMINI_CLI_VERSION=latest
ARG ACTUAL_USER=menny

LABEL description="A general use Android docker for local personal development with pnpm, nodejs, and @google/gemini-cli"
LABEL version="${IMAGE_VERSION}-${GEMINI_CLI_VERSION}"
LABEL version="${IMAGE_VERSION}"
LABEL maintainer="menny@evendanan.net"

# Install nodejs and pnpm. Taken from https://nodejs.org/en/download/current
ENV NVM_DIR=/opt/nvm
RUN mkdir -p ${NVM_DIR}
# Download and install nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

ENV PNPM_HOME="/opt/.pnpm"
ENV PATH=${PNPM_HOME}:${PATH}

# Source nvm and install Node.js
RUN . "$NVM_DIR/nvm.sh" && \
nvm install 24 && \
nvm use 24 && \
nvm alias default 24

# Verify Node.js installation
RUN . "$NVM_DIR/nvm.sh" && \
node -v && \
nvm current

# Enable pnpm via corepack
RUN . "$NVM_DIR/nvm.sh" && corepack enable pnpm

# Verify pnpm installation
RUN . "$NVM_DIR/nvm.sh" && pnpm -v && SHELL=/bin/zsh pnpm setup

# Install Gemini CLI
RUN . "$NVM_DIR/nvm.sh" && pnpm add -g @google/gemini-cli@${GEMINI_CLI_VERSION}

# Install dependencies
RUN apt update \
&& apt install -y --allow-remove-essential --allow-change-held-packages \
zsh openssh-server tmux \
openssh-server \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
49 changes: 49 additions & 0 deletions android_dev_base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
ARG IMAGE_VERSION
FROM menny/android_bazel:${IMAGE_VERSION}

ARG IMAGE_VERSION

LABEL description="A general use Android docker for local personal development with pnpm, nodejs, and @google/gemini-cli"
LABEL version="${IMAGE_VERSION}"
LABEL maintainer="menny@evendanan.net"

# Install nodejs and pnpm. Taken from https://nodejs.org/en/download/current
ENV NVM_DIR=/opt/nvm
RUN mkdir -p ${NVM_DIR}
# Download and install nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

ENV PNPM_HOME="/opt/.pnpm"
ENV PATH=${PNPM_HOME}:${PATH}

# Source nvm and install Node.js
RUN . "$NVM_DIR/nvm.sh" && \
nvm install 24 && \
nvm use 24 && \
nvm alias default 24

# Verify Node.js installation
RUN . "$NVM_DIR/nvm.sh" && \
node -v && \
nvm current

# Enable pnpm via corepack
RUN . "$NVM_DIR/nvm.sh" && corepack enable pnpm

# Verify pnpm installation
RUN . "$NVM_DIR/nvm.sh" && pnpm -v && SHELL=/bin/zsh pnpm setup

# Install Gemini CLI and Claude Code
RUN . "$NVM_DIR/nvm.sh" && pnpm add -g @google/gemini-cli@latest @anthropic-ai/claude-code@latest

# Install dependencies
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update \
&& apt install -y --allow-remove-essential --allow-change-held-packages \
zsh tmux gh \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /opt/workspace
43 changes: 43 additions & 0 deletions android_dev_base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Android Dev Docker Image

This Docker image is designed for local personal Android development and includes a variety of tools to streamline your workflow.

## Included Tools

* **pnpm**: A fast and disk-space-efficient package manager for Node.js.
* **Node.js**: A JavaScript runtime built on Chrome's V8 JavaScript engine.
* **@google/gemini-cli**: A command-line interface for Google's Gemini models.
* **zsh**: A powerful and feature-rich shell.
* **oh-my-zsh**: A framework for managing your zsh configuration.

## Building the Image

To build the image, run the following command from the root of the repository:

```bash
docker build -t android_dev -f android_dev/Dockerfile .
```

## Running the Image

To run the image, use the following command:

```bash
docker run -it -v ~/.ssh:/root/.ssh android_dev
```

This will start an interactive shell in the container. The `-v ~/.ssh:/root/.ssh` flag mounts your host's SSH keys into the container, which is necessary for cloning private repositories.

### Cloning a Repository

The `entrypoint.sh` script will automatically clone a git repository when the container starts. You can customize the repository, branch, and provider using the following environment variables:

* `git_repo`: The repository to clone. Defaults to `AnySoftKeyboard/AnySoftKeyboard`.
* `git_brach`: The branch to clone. Defaults to `main`.
* `git_provider`: The git provider. Defaults to `github.com`.

For example, to clone a different repository, you can run the following command:

```bash
docker run -it -v ~/.ssh:/root/.ssh -e git_repo="my-repo/my-project" -e git_brach="main" menny/android_dev:latest
```
4 changes: 4 additions & 0 deletions local_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ pushd android_bazel
build_image android_bazel
popd

pushd android_dev_base
build_image android_dev_base
popd

pushd android_dev
build_image android_dev
popd