• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Flutter (https://flutter.dev) Development Environment for Linux
2# ===============================================================
3#
4# This environment passes all Linux Flutter Doctor checks and is sufficient
5# for building Android applications and running Flutter tests.
6#
7# To build iOS applications, a Mac development environment is necessary.
8#
9# This includes applications and sdks that are needed only by the CI system
10# for performing pushes to production, and so this image is quite a bit larger
11# than strictly needed for just building Flutter apps.
12
13FROM debian:stretch
14MAINTAINER Flutter Developers <flutter-dev@googlegroups.com>
15
16RUN apt-get update -y
17RUN apt-get upgrade -y
18
19# Install basics
20RUN apt-get install -y --no-install-recommends \
21  git \
22  wget \
23  curl \
24  zip \
25  unzip \
26  apt-transport-https \
27  ca-certificates \
28  gnupg
29
30# Add repo for chrome stable
31RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
32RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list
33
34# Add repo for gcloud sdk and install it
35RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | \
36    tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
37
38RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
39    apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
40
41RUN apt-get update && apt-get install -y google-cloud-sdk && \
42    gcloud config set core/disable_usage_reporting true && \
43    gcloud config set component_manager/disable_update_check true
44
45# Add nodejs repository to apt sources and install it.
46ENV NODEJS_INSTALL="/opt/nodejs_install"
47RUN mkdir -p "${NODEJS_INSTALL}"
48RUN wget -q https://deb.nodesource.com/setup_10.x -O "${NODEJS_INSTALL}/nodejs_install.sh"
49RUN bash "${NODEJS_INSTALL}/nodejs_install.sh"
50
51# Install the rest of the dependencies.
52RUN apt-get install -y --no-install-recommends \
53  locales \
54  golang \
55  ruby \
56  ruby-dev \
57  nodejs \
58  lib32stdc++6 \
59  libstdc++6 \
60  libglu1-mesa \
61  build-essential \
62  default-jdk-headless \
63  google-chrome-stable
64
65# Install the Android SDK Dependency.
66ENV ANDROID_SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip"
67ENV ANDROID_TOOLS_ROOT="/opt/android_sdk"
68RUN mkdir -p "${ANDROID_TOOLS_ROOT}"
69RUN mkdir -p ~/.android
70# Silence warning.
71RUN touch ~/.android/repositories.cfg
72ENV ANDROID_SDK_ARCHIVE="${ANDROID_TOOLS_ROOT}/archive"
73RUN wget --progress=dot:giga "${ANDROID_SDK_URL}" -O "${ANDROID_SDK_ARCHIVE}"
74RUN unzip -q -d "${ANDROID_TOOLS_ROOT}" "${ANDROID_SDK_ARCHIVE}"
75# Suppressing output of sdkmanager to keep log size down
76# (it prints install progress WAY too often).
77RUN yes "y" | "${ANDROID_TOOLS_ROOT}/tools/bin/sdkmanager" "tools" > /dev/null
78RUN yes "y" | "${ANDROID_TOOLS_ROOT}/tools/bin/sdkmanager" "build-tools;28.0.3" > /dev/null
79RUN yes "y" | "${ANDROID_TOOLS_ROOT}/tools/bin/sdkmanager" "platforms;android-28" > /dev/null
80RUN yes "y" | "${ANDROID_TOOLS_ROOT}/tools/bin/sdkmanager" "platform-tools" > /dev/null
81RUN yes "y" | "${ANDROID_TOOLS_ROOT}/tools/bin/sdkmanager" "extras;android;m2repository" > /dev/null
82RUN yes "y" | "${ANDROID_TOOLS_ROOT}/tools/bin/sdkmanager" "extras;google;m2repository" > /dev/null
83RUN yes "y" | "${ANDROID_TOOLS_ROOT}/tools/bin/sdkmanager" "patcher;v4" > /dev/null
84RUN rm "${ANDROID_SDK_ARCHIVE}"
85ENV PATH="${ANDROID_TOOLS_ROOT}/tools:${PATH}"
86ENV PATH="${ANDROID_TOOLS_ROOT}/tools/bin:${PATH}"
87# Silence warnings when accepting android licenses.
88RUN mkdir -p ~/.android
89RUN touch ~/.android/repositories.cfg
90
91# Setup gradle
92ENV GRADLE_ROOT="/opt/gradle"
93RUN mkdir -p "${GRADLE_ROOT}"
94ENV GRADLE_ARCHIVE="${GRADLE_ROOT}/gradle.zip"
95ENV GRADLE_URL="http://services.gradle.org/distributions/gradle-4.4-bin.zip"
96RUN wget --progress=dot:giga "$GRADLE_URL" -O "${GRADLE_ARCHIVE}"
97RUN unzip -q -d "${GRADLE_ROOT}" "${GRADLE_ARCHIVE}"
98ENV PATH="$GRADLE_ROOT/bin:$PATH"
99
100# Add npm to path.
101ENV PATH="/usr/bin:${PATH}"
102RUN dpkg-query -L nodejs
103# Install Firebase
104# This is why we need nodejs installed.
105RUN /usr/bin/npm --verbose install -g firebase-tools
106# TODO(dnfield): Remove this once Firebase has a fix upstream for
107# https://github.com/flutter/flutter/issues/34435
108COPY patch_firebase.sh /root/patch_firebase.sh
109RUN /root/patch_firebase.sh
110
111# Install dashing
112# This is why we need golang installed.
113RUN mkdir -p /opt/gopath/bin
114ENV GOPATH=/opt/gopath
115ENV PATH="${GOPATH}/bin:${PATH}"
116RUN go get -u github.com/technosophos/dashing
117
118# Set locale to en_US
119RUN locale-gen en_US "en_US.UTF-8" && dpkg-reconfigure locales
120ENV LANG en_US.UTF-8
121
122# Install coveralls and Firebase
123# This is why we need ruby installed.
124# Skip all the documentation (-N) since it's just on CI.
125RUN gem install coveralls -N
126RUN gem install bundler -N
127# Install fastlane which is used on Linux to build and deploy Android
128# builds to the Play Store.
129RUN gem install fastlane -N
130
131