From 147ec0c34527dc93f0e151f9814c855de653dd53 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Mon, 6 Feb 2023 10:57:28 -0800 Subject: [PATCH] incorperate cirruslabs dockerfiles into linux build in order to control base os version + glibc; also fix prune apt lists to save a GB of space --- README.md | 10 ++++--- linux/Dockerfile | 69 +++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 73 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e854d3a..10ee01c 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,15 @@ Dockerfiles @ [git.openprivacy.ca/openprivacy/flutter-desktop](https://git.openprivacy.ca/openprivacy/flutter-desktop) -These docker containers are built on containers from [cirrusci](https://hub.docker.com/u/cirrusci) ([cirruslabs](https://github.com/cirruslabs)). +These docker containers incorporate or are build on [cirrusci](https://hub.docker.com/u/cirrusci) ([cirruslabs](https://github.com/cirruslabs)). -- linux-fstable-3.3.8 is cirrusci/flutter:3.3.8 + apt installing the needed utils (including npm and cucumber-html-reporter) +- linux-fstable-3.7.1 is flutter 3.7.1, glibc 2.31, apt installing the needed utils including npm, cucumber-html-reporter + - incorperated [cirrusci](https://hub.docker.com/u/cirrusci) Dockerfiles directly into linux Dockerfile to control base OS version (revert to ubuntu 20.04) to get older glibc (2.31) to support older distros +- windows-sdk30-fstable-3.7.1 is cirrusci/android-sdk:30-windowsservercore-2019 with Visual Studio 16, Flutter stable (3.7.1), and Google Root cert gtsr1 (for future proofing pub get) +- linux-fstable-3.3.8 is cirrusci/flutter:3.3.9 + apt installing the needed utils (glibc 2.31) (including npm and cucumber-html-reporter) + - manually rebuilt parent containers with ubuntu 20.04 for glibc 2.31 for greater compatibility - windows-sdk30-fstable-3.3.8 is cirrusci/android-sdk:30-windowsservercore-2019 with Visual Studio 16, Flutter stable (3.3.8), and Google Root cert gtsr1 (for future proofing pub get) - +- linux-fstable-3.3.8 is cirrusci/flutter:3.3.8 + apt installing the needed utils (glibc 2.31) (including npm and cucumber-html-reporter) - linux-fstable-3.0.1 is cirrusci/flutter:3.0.1 + apt installing the needed utils (including npm and cucumber-html-reporter) - linux-fstable-2.8.1 is cirrusci/flutter:2.8.0 + apt installing the needed utils (including npm and cucumber-html-reporter) - linux-fstable-2.8.0 is cirrusci/flutter:2.8.0 + apt installing the needed utils diff --git a/linux/Dockerfile b/linux/Dockerfile index 5f2729e..21d74b9 100644 --- a/linux/Dockerfile +++ b/linux/Dockerfile @@ -1,6 +1,69 @@ -FROM cirrusci/flutter:3.3.8 +## cirruslabs/docker-images-android/sdk/tools +FROM ubuntu:20.04 -RUN apt-get update -RUN apt-get install -y --no-install-recommends cmake ninja-build clang build-essential pkg-config libgtk-3-dev liblzma-dev lcov npm +USER root + +ENV ANDROID_HOME=/opt/android-sdk-linux \ + LANG=en_US.UTF-8 \ + LC_ALL=en_US.UTF-8 \ + LANGUAGE=en_US:en + +ENV ANDROID_SDK_ROOT=$ANDROID_HOME \ + PATH=${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/emulator + +# comes from https://developer.android.com/studio/#command-tools +ENV ANDROID_SDK_TOOLS_VERSION 8092744 + +RUN set -o xtrace \ + && cd /opt \ + && apt-get update \ + && apt-get install -y openjdk-11-jdk \ + && apt-get install -y sudo wget zip unzip git openssh-client curl bc software-properties-common build-essential ruby-full ruby-bundler libstdc++6 libpulse0 libglu1-mesa locales lcov libsqlite3-0 --no-install-recommends \ + # for x86 emulators + && apt-get install -y libxtst6 libnss3-dev libnspr4 libxss1 libasound2 libatk-bridge2.0-0 libgtk-3-0 libgdk-pixbuf2.0-0 \ + && rm -rf /var/lib/apt/lists/* \ + && sh -c 'echo "en_US.UTF-8 UTF-8" > /etc/locale.gen' \ + && locale-gen \ + && update-locale LANG=en_US.UTF-8 \ + && wget -q https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS_VERSION}_latest.zip -O android-sdk-tools.zip \ + && mkdir -p ${ANDROID_HOME}/cmdline-tools/ \ + && unzip -q android-sdk-tools.zip -d ${ANDROID_HOME}/cmdline-tools/ \ + && mv ${ANDROID_HOME}/cmdline-tools/cmdline-tools ${ANDROID_HOME}/cmdline-tools/latest \ + && chown -R root:root $ANDROID_HOME \ + && rm android-sdk-tools.zip \ + && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \ + && yes | sdkmanager --licenses \ + && wget -O /usr/bin/android-wait-for-emulator https://raw.githubusercontent.com/travis-ci/travis-cookbooks/master/community-cookbooks/android-sdk/files/default/android-wait-for-emulator \ + && chmod +x /usr/bin/android-wait-for-emulator \ + && touch /root/.android/repositories.cfg \ + && sdkmanager platform-tools \ + && mkdir -p /root/.android \ + && touch /root/.android/repositories.cfg \ + && git config --global user.email "support@cirruslabs.org" \ + && git config --global user.name "Cirrus CI" + +RUN if [[ $(uname -m) == "x86_64" ]] ; then sdkmanager emulator ; fi + +## cirruslabs/docker-images-flutter/sdk + +# USER root + +ENV FLUTTER_HOME=${HOME}/sdks/flutter \ + FLUTTER_VERSION=3.7.1 +ENV FLUTTER_ROOT=$FLUTTER_HOME + +ENV PATH ${PATH}:${FLUTTER_HOME}/bin:${FLUTTER_HOME}/bin/cache/dart-sdk/bin + +RUN git clone --depth 1 --branch $FLUTTER_VERSION https://github.com/flutter/flutter.git ${FLUTTER_HOME} + +RUN yes | flutter doctor --android-licenses \ + && flutter doctor \ + && chown -R root:root ${FLUTTER_HOME} + +## openprivacy/flutter-desktop/linux + +RUN apt-get update \ + && apt-get install -y --no-install-recommends cmake ninja-build clang build-essential pkg-config libgtk-3-dev liblzma-dev lcov npm \ + && rm -rf /var/lib/apt/lists/* RUN npm install -g cucumber-html-reporter --save-dev RUN flutter config --enable-linux-desktop