Files
AudioManagerClient/ci/Dockerfile
T
TapTap 67414b5986
CI / build (push) Successful in 2m2s
ci: install API 36 without a SIGPIPE from yes
Also add platform 36 to the CI image for the next rebuild.
2026-11-15 18:40:44 +00:00

67 lines
2.5 KiB
Docker

# Build image for the AudioManager client pipeline.
#
# Build and push it with scripts/build-ci-image.sh after changing this file or
# the Android/Kotlin versions.
FROM gradle:8.14.3-jdk21
ARG NODE_VERSION=22.14.0
ARG ANDROID_CMDLINE_TOOLS=11076708
ENV ANDROID_HOME=/opt/android-sdk \
ANDROID_SDK_ROOT=/opt/android-sdk \
GRADLE_USER_HOME=/root/.gradle
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
python3 \
xz-utils \
unzip \
zip \
&& rm -rf /var/lib/apt/lists/*
# JavaScript actions (checkout, upload-artifact) run inside the job container.
RUN curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz" \
-o /tmp/node.tar.xz \
&& tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 \
&& rm /tmp/node.tar.xz \
&& node --version \
&& npm --version
RUN mkdir -p "$ANDROID_HOME/cmdline-tools" \
&& curl -fsSL "https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_CMDLINE_TOOLS}_latest.zip" \
-o /tmp/cmdline-tools.zip \
&& unzip -q /tmp/cmdline-tools.zip -d "$ANDROID_HOME/cmdline-tools" \
&& mv "$ANDROID_HOME/cmdline-tools/cmdline-tools" "$ANDROID_HOME/cmdline-tools/latest" \
&& rm /tmp/cmdline-tools.zip \
&& yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses > /dev/null \
&& "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" \
"platform-tools" \
"platforms;android-36" \
"build-tools;36.0.0" \
&& rm -rf "$ANDROID_HOME/.temp" "$ANDROID_HOME/.downloadIntermediates"
# Warm the Gradle dependency cache and the Kotlin/Wasm (node, yarn, binaryen)
# toolchain so CI jobs do not download them on every run. Rebuild this image
# when dependencies change.
COPY . /warmup
WORKDIR /warmup
# Warm dependencies and the common/Android/desktop compilers here. The Wasm
# executable build is memory hungry and stays in the web job, but node and yarn
# are cached: Kotlin downloads them from GitHub, which has been flaky during CI.
RUN sed -i 's/kotlin.daemon.jvmargs=-Xmx3g/kotlin.daemon.jvmargs=-Xmx2g/' gradle.properties \
&& gradle --no-daemon --max-workers=2 \
:kotlinNodeJsSetup \
:kotlinYarnSetup \
:composeApp:desktopTest \
:composeApp:assembleDebug \
:composeApp:compileKotlinWasmJs \
--console=plain \
&& rm -rf /warmup
WORKDIR /workspace
CMD ["sleep", "infinity"]