Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Flutter SDK builder image #2976

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 4 additions & 34 deletions .cloud_build/flutter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Source:
# Modified for use by DartPad from community builder by Chinmay Garde:
# https://github.com/GoogleCloudPlatform/cloud-builders-community/blob/master/flutter/Dockerfile
#
# Flutter (https://flutter.io) Developement Environment for Linux
# ===============================================================
#
# This environment passes all Linux Flutter Doctor checks and is sufficient
# for building Android applications and running Flutter tests.
#
# To build iOS applications, a Mac development environment is necessary.
#

FROM debian:bookworm
MAINTAINER Chinmay Garde <chinmaygarde@google.com>
FROM debian:bookworm-slim

# Install Dependencies.
RUN apt update -y
Expand All @@ -21,35 +11,15 @@ RUN apt install -y \
curl \
unzip \
lib32stdc++6 \
libglu1-mesa \
default-jdk-headless

# Install the Android SDK Dependency.
ENV ANDROID_SDK_URL="https://dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip"
ENV ANDROID_TOOLS_ROOT="/opt/android_sdk"
RUN mkdir -p "${ANDROID_TOOLS_ROOT}/cmdline-tools"
ENV ANDROID_SDK_ARCHIVE="${ANDROID_TOOLS_ROOT}/archive"
RUN wget -q "${ANDROID_SDK_URL}" -O "${ANDROID_SDK_ARCHIVE}"
RUN unzip -q -d "${ANDROID_TOOLS_ROOT}/cmdline-tools" "${ANDROID_SDK_ARCHIVE}"
RUN mv "${ANDROID_TOOLS_ROOT}/cmdline-tools/cmdline-tools" "${ANDROID_TOOLS_ROOT}/cmdline-tools/latest"
RUN yes "y" | "${ANDROID_TOOLS_ROOT}/cmdline-tools/latest/bin/sdkmanager" "build-tools;28.0.0"
RUN yes "y" | "${ANDROID_TOOLS_ROOT}/cmdline-tools/latest/bin/sdkmanager" "platforms;android-28"
RUN yes "y" | "${ANDROID_TOOLS_ROOT}/cmdline-tools/latest/bin/sdkmanager" "platform-tools"
RUN rm "${ANDROID_SDK_ARCHIVE}"
ENV PATH="${ANDROID_TOOLS_ROOT}/cmdline-tools/latest:${PATH}"
ENV PATH="${ANDROID_TOOLS_ROOT}/cmdline-tools/latest/bin:${PATH}"
libglu1-mesa

# Install Flutter.
ENV FLUTTER_ROOT="/opt/flutter"
RUN git clone https://github.com/flutter/flutter "${FLUTTER_ROOT}"
ENV PATH="${FLUTTER_ROOT}/bin:${PATH}"
ENV ANDROID_HOME="${ANDROID_TOOLS_ROOT}"

# Disable analytics and crash reporting on the builder.
RUN flutter config --no-analytics

# Accept licenses.
RUN yes "y" | flutter doctor --android-licenses
RUN flutter config --disable-analytics

# Perform a doctor run.
RUN flutter doctor -v
Expand Down
Loading