anchor.diff:  # Inspired by:
   # https://hub.docker.com/r/runmymind/docker-android-sdk/~/dockerfile/
   
  -FROM ubuntu:17.10
  +FROM ubuntu:18.04
   
   MAINTAINER Sebastian Kaspari "skaspari@mozilla.com"
   
   # -- System -----------------------------------------------------------------------------
   
  -# Because this image is based on a very old Ubuntu, we have to grab the index for
  -# an alternative source.
  -RUN sed -i -e 's/archive\.ubuntu\.com/old-releases\.ubuntu\.com/' /etc/apt/sources.list
  -RUN sed -i -e 's/security\.ubuntu\.com/old-releases\.ubuntu\.com/' /etc/apt/sources.list
  +ENV GRADLE_OPTS='-Xmx4096m -Dorg.gradle.daemon=false' \
  +    LANG='en_US.UTF-8' \
  +    TERM='dumb'
   
  -RUN apt-get update -qq
  -
  -RUN apt-get install -y openjdk-8-jdk \
  -					   wget \
  -					   expect \
  -					   git \
  -					   curl \
  -					   ruby \
  -					   ruby-dev \
  -					   ruby-build \
  -					   python \
  -					   python-pip \
  -					   optipng \
  -					   imagemagick \
  -					   locales
  +RUN apt-get update -qq \
  +    # We need to install tzdata before all of the other packages. Otherwise it will show an interactive dialog
  +    # which we cannot navigate while building the Docker image.
  +    && apt-get install -y tzdata \
  +    && apt-get install -y openjdk-8-jdk \
  +                          expect \
  +                          git \
  +                          curl \
  +                          python \
  +                          python-pip \
  +                          python3 \
  +                          locales \
  +                          unzip \
  +			  mercurial \
  +    && apt-get clean
   
   # Today's Fastlane depends on a newer Ruby version than Ubuntu 17.10 has, so since
   # fastlane is only used for screenshots (afaik) just skip it.
  
positive.code: 
  # Build project and run gradle tasks once to pull all dependencies
  WORKDIR /opt/focus-android
  RUN ./gradlew --no-daemon assemble testFocusX86DebugUnitTest lint detektCheck ktlint
  
  # -- Post setup -------------------------------------------------------------------------
  
  # Install dependencies needed to run Android2Po
  RUN pip install -r tools/l10n/android2po/requirements.txt
  
  # Install taskcluster python library (used by decision tasks)
  # 5.0.0 is still incompatible with taskclusterProxy, meaning no decision task is able
  # to schedule the rest of the Taskcluster tasks. Please upgrade to taskcluster>=5 once
  # https://bugzilla.mozilla.org/show_bug.cgi?id=1460015 is fixed
  RUN pip install 'taskcluster>=4,<5'
  
  # Install Google Cloud SDK for using Firebase Device Lab
  RUN curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-184.0.0-linux-x86_64.tar.gz --output /gcloud.tar.gz
  RUN tar -xvf /gcloud.tar.gz -C /
  RUN /google-cloud-sdk/install.sh --quiet
  RUN /google-cloud-sdk/bin/gcloud --quiet components update
  
  # Needed for verifying cyclic redundancy check (CRC) headers (Google Cloud SDK)
  RUN apt-get install gcc python-dev python-setuptools
  RUN easy_install -U pip
  RUN pip install -U crcmod
  
  # -- Cleanup ----------------------------------------------------------------------------
  
  RUN apt-get clean
  
negative.code: 
  # -- Android SDK ------------------------------------------------------------------------
  
  RUN cd /opt && curl --location --retry 5 --output android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip \
    && unzip -d /opt/android-sdk-linux android-sdk.zip \
    && rm -f android-sdk.zip
  
  ENV ANDROID_SDK_HOME /opt/android-sdk-linux
  ENV ANDROID_HOME /opt/android-sdk-linux
  
  RUN yes | "${ANDROID_SDK_HOME}/tools/bin/sdkmanager" --licenses
  
  # -- Project setup ----------------------------------------------------------------------
  
  