fix(ci): address remaining review feedback
- Remove dead ci.Dockerfile (not referenced by CI workflows) - Fix release.yml: all ubuntu-latest -> ubuntu-24.04 - Fix release.yml: JDK via apt-get instead of curl download - Fix release.yml: hardcoded *** token -> use GITEA_TOKEN secret - Fix release.yml: JAVA_HOME path consistency
This commit is contained in:
1 parent
d8942e5b61
commit
62e6b8d3b6
2 files changed
+11
-72
No files matched your search
@@ -1,59 +0,0 @@
|
||||
# CI-optimized image for kryz-go-flutter
|
||||
# Build once on the runner host:
|
||||
# docker build -f .devcontainer/ci.Dockerfile -t kryz-ci:latest .devcontainer
|
||||
# Then all CI jobs use this image — no SDK downloads needed.
|
||||
#
|
||||
# First build: ~30 min (downloads Flutter + Android SDK)
|
||||
# Subsequent builds: ~1 min (Docker layer caching)
|
||||
# CI runtime without image: ~40 min (redownloads everything per job)
|
||||
# CI runtime with image: ~2-5 min
|
||||
|
||||
FROM --platform=linux/amd64 debian:bookworm-slim
|
||||
|
||||
ARG FLUTTER_VERSION=3.44.0
|
||||
|
||||
ENV FLUTTER_HOME=/opt/flutter
|
||||
ENV ANDROID_HOME=/opt/android-sdk
|
||||
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
|
||||
ENV PATH="${FLUTTER_HOME}/bin:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${JAVA_HOME}/bin:${PATH}"
|
||||
|
||||
# ── Layer 1: system dependencies ──────────────────────────────────
|
||||
# Stable layer — only rebuilds when package list changes
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
wget curl unzip git xz-utils zip python3 libgtk-3-dev ninja-build \
|
||||
openjdk-17-jre-headless \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& rm -rf /tmp/* /var/tmp/*
|
||||
|
||||
# ── Layer 2: Flutter SDK (tarball, not git clone) ─────────────────
|
||||
# Tarball is deterministic — layer stays cached until FLUTTER_VERSION changes
|
||||
RUN wget -q "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${FLUTTER_VERSION}-stable.tar.xz" \
|
||||
-O /tmp/flutter.tar.xz \
|
||||
&& tar -xf /tmp/flutter.tar.xz -C /opt \
|
||||
&& rm /tmp/flutter.tar.xz \
|
||||
&& chmod -R a+r ${FLUTTER_HOME}
|
||||
|
||||
# ── Layer 3: Android SDK ──────────────────────────────────────────
|
||||
# Only rebuilds when cmdline-tools version changes
|
||||
RUN mkdir -p ${ANDROID_HOME}/cmdline-tools \
|
||||
&& wget -q https://dl.google.com/android/repository/commandlinetools-linux-11076708_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 | sdkmanager --licenses \
|
||||
&& sdkmanager "platform-tools" "platforms;android-35" "build-tools;35.0.0" \
|
||||
&& chmod -R a+r ${ANDROID_HOME}
|
||||
|
||||
# ── Layer 4: Flutter precache (bakes platform artifacts into image) ──
|
||||
# Runs once — cached in the image layer
|
||||
RUN flutter precache --android \
|
||||
&& rm -rf ~/.cache/flutter/*/http_* \
|
||||
&& rm -rf /tmp/*
|
||||
|
||||
# ── Layer 5: non-root user ────────────────────────────────────────
|
||||
RUN groupadd -g 1000 vscode \
|
||||
&& useradd -u 1000 -g 1000 -m -s /bin/bash vscode \
|
||||
&& chown -R vscode:vscode ${ANDROID_HOME} ${FLUTTER_HOME} /home/vscode
|
||||
|
||||
USER vscode
|
||||
WORKDIR /home/vscode/projects
|
||||
Reference in new issue
Block a user