Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
4c87014
chore(devcontainer): fix dockerfile broken yarn repo in base image
UnschooledGamer Apr 27, 2026
748dd87
Update .devcontainer/devcontainer.json
UnschooledGamer Apr 27, 2026
def1fcc
Update Dockerfile
UnschooledGamer Apr 27, 2026
7da39e9
Update devcontainer.json
UnschooledGamer Apr 27, 2026
9f16675
Update Dockerfile
UnschooledGamer Apr 27, 2026
9fea25c
Update devcontainer.json
UnschooledGamer Apr 27, 2026
0129870
remove: redundant pnpm installation.
UnschooledGamer Apr 27, 2026
96cb3af
chore(dockerFile): dual android sdk installation and conflicts betwee…
UnschooledGamer Apr 28, 2026
78d6741
Merge remote-tracking branch 'origin/main' into fix/devcontainer-config
UnschooledGamer Apr 28, 2026
9bc0661
Update .devcontainer/Dockerfile
UnschooledGamer Apr 28, 2026
a8ebdb4
Update Dockerfile to install Android SDK conditionally
UnschooledGamer Apr 28, 2026
731f7e0
chore(docker): split into multi-stage setup to allow devcontainers
UnschooledGamer Apr 29, 2026
7cda01c
remove(contributing): dockerFile uncomment note as it's resolved now.
UnschooledGamer Apr 29, 2026
8dbc2df
fix `ARG` order in the dockerFile
UnschooledGamer Apr 29, 2026
f43b332
update: specify 'standalone' target in Docker build command
UnschooledGamer Apr 29, 2026
e9c0d53
fix: move ARG below FROM
UnschooledGamer Apr 29, 2026
090d876
update: ANDROID paths
UnschooledGamer Apr 29, 2026
aaabb81
update(CONTRIBUTING.md): add note for podman
UnschooledGamer Apr 29, 2026
fabd526
fix(CONTRIBUTING.md): `Podmon` to Podman.
UnschooledGamer Apr 29, 2026
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
55 changes: 33 additions & 22 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
# Acode Development Container - Standalone Docker Build
#
# This Dockerfile is for MANUAL Docker builds (docker build/run).
# Usage:
# docker build -t acode-dev .devcontainer/
# Acode Development Container
#
# Devcontainer usage: automatic via devcontainer.json
# Standalone usage:
# docker build --target standalone -t acode-dev .devcontainer/
# docker run -it -v $(pwd):/workspaces/acode acode-dev

FROM mcr.microsoft.com/devcontainers/java:1-21-bullseye
FROM mcr.microsoft.com/devcontainers/java:1-21-bullseye AS base

ARG ANDROID_PLATFORM=36
ARG ANDROID_BUILD_TOOLS=36.0.0
ARG CMDLINE_TOOLS_VERSION=11076708
ARG NODE_VERSION=22
ARG GRADLE_VERSION=8.11

ENV ANDROID_HOME=/opt/android-sdk
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV GRADLE_HOME=/opt/gradle
ENV PATH="${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${GRADLE_HOME}/bin"

# removes broken yarn repo present in base image
RUN rm -f /etc/apt/sources.list.d/yarn.list
Expand All @@ -33,17 +30,26 @@ RUN wget -q "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-
&& rm /tmp/gradle.zip \
&& ln -s /opt/gradle-${GRADLE_VERSION} ${GRADLE_HOME}

# Install fnm and Node.js
# Not required, mostly. When dev containers are used.
# ENV FNM_DIR=/usr/local/fnm
# ENV PATH="${FNM_DIR}:${PATH}"
# RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "${FNM_DIR}" --skip-shell \
# && eval "$(${FNM_DIR}/fnm env)" \
# && fnm install ${NODE_VERSION} \
# && fnm default ${NODE_VERSION} \
# && npm install -g pnpm
ENV PATH="${PATH}:${GRADLE_HOME}/bin"

WORKDIR /workspaces/acode

LABEL org.opencontainers.image.authors="Acode Foundation <https://github.com/Acode-Foundation/Acode>"
LABEL description="Development environment for building Acode - Code Editor for Android"


# ENV PATH="${FNM_DIR}/aliases/default/bin:${PATH}"
# Devcontainer stage
# Android SDK and Node handled by devcontainer features.
FROM base AS devcontainer


# Standalone stage
# Includes Android SDK and Node/pnpm for plain docker build/run usage.
FROM base AS standalone

ENV ANDROID_HOME=/usr/local/lib/android
ENV ANDROID_SDK_ROOT=/usr/local/lib/android
ENV PATH="${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/build-tools/${ANDROID_BUILD_TOOLS}"
Comment thread
UnschooledGamer marked this conversation as resolved.

# Install Android SDK
RUN mkdir -p ${ANDROID_HOME}/cmdline-tools \
Expand All @@ -59,7 +65,12 @@ RUN mkdir -p ${ANDROID_HOME}/cmdline-tools \
"platforms;android-${ANDROID_PLATFORM}" \
"build-tools;${ANDROID_BUILD_TOOLS}"
Comment thread
UnschooledGamer marked this conversation as resolved.

WORKDIR /workspaces/acode
# Install fnm and Node.js
ENV FNM_DIR=/usr/local/fnm
RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "${FNM_DIR}" --skip-shell \
&& eval "$(${FNM_DIR}/fnm env)" \
&& fnm install ${NODE_VERSION} \
&& fnm default ${NODE_VERSION} \
&& npm install -g pnpm

LABEL maintainer="Acode Foundation"
LABEL description="Development environment for building Acode - Code Editor for Android"
ENV PATH="${FNM_DIR}/aliases/default/bin:${PATH}"
9 changes: 6 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
{
"name": "Acode Development",
"build": {
"dockerfile": "Dockerfile"
"dockerfile": "Dockerfile",
"target": "devcontainer"
},

"containerEnv": {
"JAVA_HOME": "/usr/local/openjdk-21"
},
"remoteEnv": {
"JAVA_HOME": "/usr/local/openjdk-21"
"JAVA_HOME": "/usr/local/openjdk-21",
"ANDROID_SDK_ROOT": "${containerEnv:ANDROID_HOME}",
Comment thread
UnschooledGamer marked this conversation as resolved.
"PATH": "${containerEnv:PATH}:${containerEnv:ANDROID_HOME}/build-tools/36.0.0"
Comment thread
UnschooledGamer marked this conversation as resolved.
},

"features": {
"ghcr.io/nordcominc/devcontainer-features/android-sdk:1": {
"platform": "36",
"build_tools": "36.0.0"
},
"ghcr.io/devcontainers/features/node:1": {
"ghcr.io/devcontainers/features/node:2.0": {
"nodeGypDependencies": false,
"installYarnUsingApt": false,
"version": "lts",
Expand Down
7 changes: 5 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Thank you for your interest in contributing to Acode! This guide will help you g

### Option 1: DevContainer (Recommended)

1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in VS Code or other editors that support DevContainers.
1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in VS Code or other editors that support [DevContainers](https://containers.dev/).

2. Clone and open the repository:
```bash
Expand All @@ -28,6 +28,9 @@ Thank you for your interest in contributing to Acode! This guide will help you g

### Option 2: Docker CLI (For Any Editor)

> [!NOTE]
> If you try to use Podman, Kindly note that it would not work properly until https://github.com/containers/buildah/pull/5845 is merged/implemented in Podman.

If your editor doesn't support DevContainers, you can use Docker directly:

```bash
Expand All @@ -36,7 +39,7 @@ git clone https://github.com/Acode-Foundation/Acode.git
cd Acode

# Build the Docker image from our Dockerfile
docker build -t acode-dev .devcontainer/
docker build --target standalone -t acode-dev .devcontainer/

# Run the container with your code mounted
docker run -it --rm \
Expand Down