Separate massive linux builder image to two smaller images

This commit is contained in:
zontreck 2024-07-22 23:10:51 -07:00
parent bd3e41a587
commit 0f680826e8
5 changed files with 57 additions and 39 deletions

14
DebianBase/Dockerfile Normal file
View file

@ -0,0 +1,14 @@
FROM debian:latest
LABEL author="Tara Piccari" maintainer="tarapiccari@gmail.com"
SHELL [ "/bin/bash", "-c" ]
ENV HOME /root
ENV DOCKER 1
USER root
WORKDIR /
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update; apt-get upgrade -y
RUN apt-get install -y rsync zip

27
DebianBuilder/Dockerfile Normal file
View file

@ -0,0 +1,27 @@
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 android-sdk android-sdk-build-tools android-sdk-platform-tools clang pkg-config unzip libgtk-3-dev zip lldb libglu1-mesa libpulse0 cargo python3-dev libffi-dev libssl-dev apt-utils
RUN apt install -y fonts-liberation libgtk-4-1 libgbm1 libu2f-udev libvulkan1 xdg-utils
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"
WORKDIR /
# Install AppImage Builder
RUN curl -sO https://github.com/AppImageCrafters/appimage-builder/releases/download/v${APPIMAGE_BUILDER_VER}/appimage-builder-${APPIMAGE_BUILDER_VER}-x86_64.AppImage
RUN mv appimage-builder-${APPIMAGE_BUILDER_VER}-x86_64.AppImage /bin/appimage-builder
RUN chmod +x /bin/appimage-builder

View file

@ -1,28 +1,13 @@
FROM debian:latest
LABEL author="Tara Piccari" maintainer="tarapiccari@gmail.com"
FROM git.zontreck.com/ariascreations/buildenvironments:debianbuild
COPY ./agent.secret /agent.secret
ENV DOCKER 1
USER root
WORKDIR /
ENV GRADLE_VERSION 8.3
ENV ANDROID_HOME "/opt/android-sdk-linux"
ENV HOME /root
ENV APPIMAGE_BUILDER_VER 1.1.0
ENV ANDROID_SDK_VER 11076708
ENV ANDROID_SDK_ROOT $ANDROID_HOME
ENV PATH $PATH:$ANDROID_HOME/cmdline-tools:$ANDROID_HOME/cmdline-tools/bin:$ANDROID_HOME/platform-tools:/flutter/bin
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update; apt-get upgrade -y
RUN apt install -y build-essential cmake ninja-build openjdk-17-jdk nasm git curl wget openjdk-17-jre android-sdk android-sdk-build-tools android-sdk-platform-tools clang pkg-config unzip libgtk-3-dev zip lldb libglu1-mesa libpulse0 cargo python3-dev libffi-dev libssl-dev apt-utils
RUN curl -sO https://ci.zontreck.com/jnlpJars/agent.jar
RUN curl -sO https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.22.3-stable.tar.xz
@ -37,8 +22,6 @@ RUN rm -v /commandlinetools-linux-${ANDROID_SDK_VER}_latest.zip
RUN mkdir -p $ANDROID_HOME/licenses
RUN yes | $ANDROID_HOME/cmdline-tools/bin/sdkmanager --licenses --sdk_root=${ANDROID_SDK_ROOT}
SHELL [ "/bin/bash", "-c" ]
RUN mkdir -p /home/adk/.android \
&& mkdir -pv /home/adk/app \
&& touch /home/adk/.android/repositories.cfg
@ -50,8 +33,6 @@ RUN curl -s "https://get.sdkman.io" | bash
ADD packages.txt $HOME
RUN apt install -y fonts-liberation libgtk-4-1 libgbm1 libu2f-udev libvulkan1 xdg-utils
RUN curl -sO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN dpkg -i google-chrome-stable_current_amd64.deb
@ -78,22 +59,11 @@ ADD pub.secret /
RUN cat /pub.secret | dart pub token add https://git.zontreck.com/api/packages/AriasCreations/pub
# Set up needed git and extra build components
RUN git config --global user.name "zontreck"
RUN git config --global user.email "tarapiccari@gmail.com"
RUN apt-get install -y rsync zip
WORKDIR /root/.ssh
ADD ./id_rsa ./id_rsa
ADD ./id_rsa.pub ./id_rsa.pub
RUN chmod 0600 id_rsa
# 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
WORKDIR /root/.gradle
ADD ./gradle.properties ./
@ -102,10 +72,4 @@ WORKDIR /
ADD ./env /env.bash
RUN source /env.bash
# Install AppImage Builder
RUN curl -sO https://github.com/AppImageCrafters/appimage-builder/releases/download/v${APPIMAGE_BUILDER_VER}/appimage-builder-${APPIMAGE_BUILDER_VER}-x86_64.AppImage
RUN mv appimage-builder-${APPIMAGE_BUILDER_VER}-x86_64.AppImage /bin/appimage-builder
RUN chmod +x /bin/appimage-builder
ENTRYPOINT [ "java", "-jar", "/agent.jar", "-url", "https://ci.zontreck.com", "-secret", "@/agent.secret", "-name", "Linux", "-workDir", "/builder" ]

View file

@ -1,7 +1,14 @@
@echo off
docker build -t git.zontreck.com/ariascreations/buildenvironments:firestormlinux FirestormLinux/Dockerfile
docker push git.zontreck.com/ariascreations/buildenvironments:firestormlinux
docker build -t git.zontreck.com/ariascreations/buildenvironments:debian DebianBase/Dockerfile
docker push git.zontreck.com/ariascreations/buildenvironments:debian
docker build -t git.zontreck.com/ariascreations/buildenvironments:debianbuild DebianBuilder/Dockerfile
docker push git.zontreck.com/ariascreations/buildenvironments:debianbuild
docker build -t git.zontreck.com/ariascreations/buildenvironments:linuxfs FirestormLinux/Dockerfile
docker push git.zontreck.com/ariascreations/buildenvironments:linuxfs
docker build -t git.zontreck.com/ariascreations/buildenvironments:linux LinuxGeneralCompiler/Dockerfile
docker push git.zontreck.com/ariascreations/buildenvironments:linux

View file

@ -1,5 +1,11 @@
#!/bin/bash
docker build -t git.zontreck.com/ariascreations/buildenvironments:debian DebianBase/Dockerfile
docker push git.zontreck.com/ariascreations/buildenvironments:debian
docker build -t git.zontreck.com/ariascreations/buildenvironments:debianbuild DebianBuilder/Dockerfile
docker push git.zontreck.com/ariascreations/buildenvironments:debianbuild
docker build -t git.zontreck.com/ariascreations/buildenvironments:firestormlinux FirestormLinux/Dockerfile
docker push git.zontreck.com/ariascreations/buildenvironments:firestormlinux