Import Cobalt 21.master.0.276581
diff --git a/src/docker/linux/android/Dockerfile b/src/docker/linux/android/Dockerfile
new file mode 100644
index 0000000..d76e0ce
--- /dev/null
+++ b/src/docker/linux/android/Dockerfile
@@ -0,0 +1,32 @@
+FROM cobalt-build-base
+
+RUN apt update -qqy \
+ && apt install -qqy --no-install-recommends \
+ binutils \
+ bison \
+ default-jdk \
+ g++-multilib \
+ ninja-build \
+ pkgconf \
+ python-requests \
+ yasm \
+ && apt-get clean autoclean \
+ && apt-get autoremove -y --purge \
+ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
+ && rm -rf /var/lib/{apt,dpkg,cache,log} \
+ && echo "Done"
+
+CMD (test -f /root/.android/debug.keystore \
+ && echo "Android debug keystore exists." \
+ || (keytool -genkey -v \
+ -keystore /root/.android/debug.keystore \
+ -dname "cn=Android Docker, ou=YouTube, o=Google, c=US" \
+ -storepass android \
+ -alias androiddebugkey \
+ -keypass android \
+ -keyalg RSA \
+ -keysize 2048 \
+ -validity 10000 \
+ && echo "Generated Android Debug keystore.")) \
+ && /code/cobalt/build/gyp_cobalt -v -C ${CONFIG} ${PLATFORM} \
+ && ninja -C ${OUTDIR}/${PLATFORM}_${CONFIG} ${TARGET:-cobalt_deploy}
diff --git a/src/docker/linux/base/Dockerfile b/src/docker/linux/base/Dockerfile
index 59e3da8..4f21c76 100644
--- a/src/docker/linux/base/Dockerfile
+++ b/src/docker/linux/base/Dockerfile
@@ -15,36 +15,4 @@
&& rm -rf /var/lib/{apt,dpkg,cache,log} \
&& echo "Done"
-# === Get Nodejs pinned LTS version via NVM
-ENV NVM_DIR /root/.nvm
-ENV NODE_VERSION 12.17.0
-
-RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh | bash
-
-RUN . $NVM_DIR/nvm.sh \
- && nvm install --lts \
- && nvm alias default lts/* \
- && nvm use default
-
-ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
-ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
-
-# === Install depot_tools
-RUN git clone https://cobalt.googlesource.com/depot_tools /depot_tools
-
-# === Configure common env vars
-ENV PATH="${PATH}:/depot_tools:/root/fake_goma" \
- OUTDIR=out \
- DEPOT_TOOLS_UPDATE=0 \
- NINJA_STATUS="[%f/%t %c/sec] " \
- CCACHE_DIR=/root/ccache \
- CCACHE_MAXSIZE=30G
-
-# == Set up gclient and fake Goma with ccache
-COPY ./files/fake_goma /root/fake_goma
-RUN cd /tmp && gclient verify || true \
- && chmod +x /root/fake_goma/gomacc /root/fake_goma/goma_ctl.py \
- && mkdir /root/ccache
-
-WORKDIR /code
CMD ["/usr/bin/python","--version"]
diff --git a/src/docker/linux/base/build/Dockerfile b/src/docker/linux/base/build/Dockerfile
new file mode 100644
index 0000000..416b5ee
--- /dev/null
+++ b/src/docker/linux/base/build/Dockerfile
@@ -0,0 +1,35 @@
+FROM cobalt-base
+
+# === Get Nodejs pinned LTS version via NVM
+ENV NVM_DIR /root/.nvm
+ENV NODE_VERSION 12.17.0
+
+RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh | bash
+
+RUN . $NVM_DIR/nvm.sh \
+ && nvm install --lts \
+ && nvm alias default lts/* \
+ && nvm use default
+
+ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
+ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
+
+# === Install depot_tools
+RUN git clone https://cobalt.googlesource.com/depot_tools /depot_tools
+
+# === Configure common env vars
+ENV PATH="${PATH}:/depot_tools:/root/fake_goma" \
+ OUTDIR=out \
+ DEPOT_TOOLS_UPDATE=0 \
+ NINJA_STATUS="[%f/%t %c/sec] " \
+ CCACHE_DIR=/root/ccache \
+ CCACHE_MAXSIZE=30G
+
+# == Set up gclient and fake Goma with ccache
+COPY ./files/fake_goma /root/fake_goma
+RUN cd /tmp && gclient verify || true \
+ && chmod +x /root/fake_goma/gomacc /root/fake_goma/goma_ctl.py \
+ && mkdir /root/ccache
+
+WORKDIR /code
+CMD ["/usr/bin/python","--version"]
diff --git a/src/docker/linux/raspi/Dockerfile b/src/docker/linux/raspi/Dockerfile
new file mode 100644
index 0000000..7ed69d0
--- /dev/null
+++ b/src/docker/linux/raspi/Dockerfile
@@ -0,0 +1,36 @@
+FROM cobalt-build-base
+
+ARG raspi_home=/root/raspi-home
+ARG raspi_sysroot=raspbian_lite_2017-07-05_sysroot.tar.xz
+
+# Required by the gyp build system.
+ENV RASPI_HOME=${raspi_home}
+
+RUN apt update -qqy \
+ && apt install -qqy --no-install-recommends \
+ binutils \
+ bison \
+ g++-multilib \
+ ninja-build \
+ pkgconf \
+ python-requests \
+ wget \
+ xz-utils \
+ yasm \
+ && apt-get clean autoclean \
+ && apt-get autoremove -y --purge \
+ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
+ && rm -rf /var/lib/{apt,dpkg,cache,log} \
+ && echo "Done"
+
+RUN mkdir -p ${raspi_home}/tools \
+ && git clone https://github.com/raspberrypi/tools.git ${raspi_home}/tools
+
+RUN cd ${raspi_home} \
+ && wget -q \
+ "https://storage.googleapis.com/cobalt-static-storage/${raspi_sysroot}"
+
+RUN cd ${raspi_home} && tar Jxpvf ${raspi_sysroot}
+
+CMD /code/cobalt/build/gyp_cobalt -v -C ${CONFIG} ${PLATFORM} \
+ && ninja -C ${OUTDIR}/${PLATFORM}_${CONFIG} ${TARGET:-cobalt_deploy}
diff --git a/src/docker/linux/unittest/Dockerfile b/src/docker/linux/unittest/Dockerfile
new file mode 100644
index 0000000..b2908a2
--- /dev/null
+++ b/src/docker/linux/unittest/Dockerfile
@@ -0,0 +1,17 @@
+FROM cobalt-base
+
+RUN apt update -qqy \
+ && apt install -qqy --no-install-recommends \
+ libx11-6 \
+ libxcomposite1 \
+ libxrender1 \
+ libasound2 \
+ && apt-get clean autoclean \
+ && apt-get autoremove -y --purge \
+ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
+ && rm -rf /var/lib/{apt,dpkg,cache,log} \
+ && echo "Done"
+
+WORKDIR /out
+
+CMD ./${TEST_TARGET}