Unverified Commit 9cea6917 authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

Switch to Debian bullseye, update nodejs to npm package, add flutter desktop...

Switch to Debian bullseye, update nodejs to npm package, add flutter desktop run dependencies (#89309)

This change updates the Dockerfile for Cirrus builds:

- Switch to a newer stable Debian build (bullseye instead of stretch)
- Eliminates the very old (10) nodejs install in favor of the npm package
- Installs OpenJDK so that Android SDK manager can run on bullseye
- Installs the prerequisites for Linux desktop flutter run.

The motivation for this change was to include the dependencies for Linux desktop flutter run so that I can run tests that use desktop Flutter apps, but that needs cmake 3.10 or later, and stretch doesn't have a cmake that new. Of course, there's also no openjdk-8-jre for bullseye, so I used OpenJDK from JFrog instead.
parent 36c51cb6
...@@ -10,15 +10,13 @@ ...@@ -10,15 +10,13 @@
# for performing pushes to production, and so this image is quite a bit larger # for performing pushes to production, and so this image is quite a bit larger
# than strictly needed for just building Flutter apps. # than strictly needed for just building Flutter apps.
# Last manual update 2020-10-05 (changing this comment will re-build image) # Last manual update 2021-09-01 (changing this comment will re-build image)
# Note: updating past stretch (Debian 9) will bump Java past version 8, FROM debian:bullseye
# which will break the Android SDK.
FROM debian:stretch
MAINTAINER Flutter Developers <flutter-dev@googlegroups.com> MAINTAINER Flutter Developers <flutter-dev@googlegroups.com>
RUN apt-get update -y RUN apt-get update -y && \
RUN apt-get upgrade -y apt-get upgrade -y
# Install basics # Install basics
RUN apt-get install -y --no-install-recommends \ RUN apt-get install -y --no-install-recommends \
...@@ -33,7 +31,8 @@ RUN apt-get install -y --no-install-recommends \ ...@@ -33,7 +31,8 @@ RUN apt-get install -y --no-install-recommends \
# Add repo for chrome stable # Add repo for chrome stable
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | \
tee /etc/apt/sources.list.d/google-chrome.list
# Add repo for gcloud sdk and install it # Add repo for gcloud sdk and install it
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | \ RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | \
...@@ -46,25 +45,29 @@ RUN apt-get update && apt-get install -y google-cloud-sdk && \ ...@@ -46,25 +45,29 @@ RUN apt-get update && apt-get install -y google-cloud-sdk && \
gcloud config set core/disable_usage_reporting true && \ gcloud config set core/disable_usage_reporting true && \
gcloud config set component_manager/disable_update_check true gcloud config set component_manager/disable_update_check true
# Add nodejs repository to apt sources and install it. # Add repo for OpenJDK 8 from JFrog.io
ENV NODEJS_INSTALL="/opt/nodejs_install" RUN wget -q -O - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add -
RUN mkdir -p "${NODEJS_INSTALL}" RUN echo 'deb [arch=amd64] https://adoptopenjdk.jfrog.io/adoptopenjdk/deb bullseye main' | \
RUN wget -q https://deb.nodesource.com/setup_10.x -O "${NODEJS_INSTALL}/nodejs_install.sh" tee /etc/apt/sources.list.d/adoptopenjdk.list
RUN bash "${NODEJS_INSTALL}/nodejs_install.sh"
# Install the rest of the dependencies. # Install the dependencies needed for the rest of the build.
RUN apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
locales \ adoptopenjdk-8-hotspot \
build-essential \
default-jdk-headless \
gcc \ gcc \
ruby \ google-chrome-stable \
ruby-dev \
nodejs \
lib32stdc++6 \ lib32stdc++6 \
libstdc++6 \
libglu1-mesa \ libglu1-mesa \
build-essential \ libstdc++6 \
default-jdk-headless \ locales \
google-chrome-stable nodejs \
npm \
ruby \
ruby-dev && \
apt-get clean
ENV JAVA_HOME="/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64"
# Install the Android SDK Dependency. # Install the Android SDK Dependency.
ENV ANDROID_SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip" ENV ANDROID_SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip"
...@@ -122,5 +125,15 @@ RUN gem install bundler -N ...@@ -122,5 +125,15 @@ RUN gem install bundler -N
COPY ci/docker_linux/Gemfile /Gemfile COPY ci/docker_linux/Gemfile /Gemfile
COPY ci/docker_linux/Gemfile.lock /Gemfile.lock COPY ci/docker_linux/Gemfile.lock /Gemfile.lock
# Install dependencies for desktop flutter run
RUN apt-get install -y --no-install-recommends \
clang \
cmake \
libgtk-3-dev \
ninja-build \
pkg-config && \
apt-get upgrade -y --no-install-recommends && \
apt-get clean
RUN bundle config set system 'true' && \ RUN bundle config set system 'true' && \
bundle install --system bundle install --system
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment