Stage some builds in separate container to reduce overall image size.

This commit is contained in:
zontreck 2024-09-04 21:24:12 -07:00
parent 23a2386cb8
commit d794774cc9
4 changed files with 27 additions and 17 deletions

View file

@ -1,3 +1,15 @@
FROM debian:latest AS ADK
ENV ANDROID_HOME "/opt/android-sdk-linux"
ENV ANDROID_SDK_VER 11076708
ENV ANDROID_SDK_ROOT $ANDROID_HOME
RUN curl -sO https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VER}_latest.zip
RUN unzip -qq /commandlinetools-linux-${ANDROID_SDK_VER}_latest.zip -d $ANDROID_SDK_ROOT
RUN rm -v /commandlinetools-linux-${ANDROID_SDK_VER}_latest.zip
FROM git.zontreck.com/ariascreations/buildenvironments:debianbuild
ENV ANDROID_HOME "/opt/android-sdk-linux"
@ -7,10 +19,7 @@ ENV ANDROID_SDK_ROOT $ANDROID_HOME
ENV PATH $PATH:$ANDROID_HOME/cmdline-tools:$ANDROID_HOME/cmdline-tools/bin:$ANDROID_HOME/platform-tools
RUN curl -sO https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VER}_latest.zip
RUN unzip -qq /commandlinetools-linux-${ANDROID_SDK_VER}_latest.zip -d $ANDROID_SDK_ROOT
RUN rm -v /commandlinetools-linux-${ANDROID_SDK_VER}_latest.zip
COPY --from=ADK ${ANDROID_HOME} ${ANDROID_HOME}
RUN mkdir -p $ANDROID_HOME/licenses
RUN yes | $ANDROID_HOME/cmdline-tools/bin/sdkmanager --licenses --sdk_root=${ANDROID_SDK_ROOT}

View file

@ -1,4 +1,4 @@
FROM debian:latest
FROM debian:bookworm
LABEL author="Tara Piccari" maintainer="tarapiccari@gmail.com"
@ -11,4 +11,4 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt update; apt-get upgrade -y
RUN apt-get install -y rsync zip unzip file
RUN apt-get install -y rsync zip unzip file git

View file

@ -1,20 +1,19 @@
FROM git.zontreck.com/ariascreations/buildenvironments:debian
ENV GRADLE_VERSION 8.3
RUN apt install -y build-essential cmake ninja-build openjdk-17-jdk nasm git curl wget openjdk-17-jre clang pkg-config libgtk-3-dev lldb libglu1-mesa libpulse0 cargo python3-dev libffi-dev libssl-dev apt-utils
RUN apt-get install -y build-essential
RUN apt install -y fonts-liberation libgtk-4-1 libgbm1 libu2f-udev libvulkan1 xdg-utils gradle
RUN apt-get install -y nasm
RUN apt-get install -y cmake ninja-build openjdk-17-jdk nasm git curl wget openjdk-17-jre clang pkg-config libgtk-3-dev lldb libglu1-mesa libpulse0 cargo python3-dev libffi-dev libssl-dev apt-utils fonts-liberation libgtk-4-1 libgbm1 libu2f-udev libvulkan1 xdg-utils gradle nasm
WORKDIR /root/.ssh
# Precache SSH Host Keys
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
RUN ssh-keyscan -p 1212 git.zontreck.com >> /root/.ssh/known_hosts
# Set up needed git and extra build components
RUN git config --global user.name "zontreck"
RUN git config --global user.email "tarapiccari@gmail.com"

View file

@ -1,20 +1,22 @@
FROM debian:bookworm AS FLUTTER
RUN curl -sO https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.24.1-stable.tar.xz
RUN tar -xf /flutter_linux_3.24.1-stable.tar.xz; rm /flutter*.xz
FROM git.zontreck.com/ariascreations/buildenvironments:adk
WORKDIR /
ENV PATH $PATH:/flutter/bin
RUN curl -sO https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.24.1-stable.tar.xz
RUN tar -xf /flutter_linux_3.24.1-stable.tar.xz; rm /flutter*.xz
COPY --from=FLUTTER /flutter /flutter
RUN curl -sO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN dpkg -i google-chrome-stable_current_amd64.deb
RUN dpkg -i google-chrome-stable_current_amd64.deb && rm google-chrome*.deb
RUN chown -R root:root /flutter
RUN /flutter/bin/flutter --disable-analytics
RUN /flutter/bin/flutter doctor
RUN /flutter/bin/flutter precache