Import Cobalt 21.master.0.300910
diff --git a/src/docker/linux/android/Dockerfile b/src/docker/linux/android/Dockerfile
index 5967e8a..7ffd336 100644
--- a/src/docker/linux/android/Dockerfile
+++ b/src/docker/linux/android/Dockerfile
@@ -1,15 +1,24 @@
+# Copyright 2021 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 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/* \
diff --git a/src/docker/linux/base/Dockerfile b/src/docker/linux/base/Dockerfile
index 2746def..02af150 100644
--- a/src/docker/linux/base/Dockerfile
+++ b/src/docker/linux/base/Dockerfile
@@ -1,3 +1,17 @@
+# Copyright 2021 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 ARG BASE_OS
 ARG BASE_OS_TAG
 FROM ${BASE_OS:-gcr.io/cloud-marketplace-containers/google/debian9}:${BASE_OS_TAG:-latest}
diff --git a/src/docker/linux/base/build/Dockerfile b/src/docker/linux/base/build/Dockerfile
index 9025693..315806d 100644
--- a/src/docker/linux/base/build/Dockerfile
+++ b/src/docker/linux/base/build/Dockerfile
@@ -1,6 +1,37 @@
+# Copyright 2021 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 ARG FROM_IMAGE
 FROM ${FROM_IMAGE:-cobalt-base}
 
+ARG gn_hash=vC0rxqiqGTD3ls9KJHrgJoWP2OBiPk_QEO_xbDItKYoC
+
+# === Install common build tools, required by all platforms
+RUN apt update -qqy \
+    && apt install -qqy --no-install-recommends \
+        binutils \
+        bison \
+        ninja-build \
+        pkgconf \
+        unzip \
+        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"
+
 # === Get Nodejs pinned LTS version via NVM
 ENV NVM_DIR /root/.nvm
 ENV NODE_VERSION 12.17.0
@@ -16,10 +47,18 @@
 ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
 
 
+# === Get GN via CIPD
+RUN curl --silent --output /tmp/gn.zip \
+    "https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/${gn_hash}"
+RUN unzip gn.zip -e /usr/local/bin
+RUN gn.zip
+
+
 # === Configure common env vars
 ENV OUTDIR=out \
     NINJA_STATUS="[%f/%t %c/sec] " \
     NINJA_PARALLEL=4 \
+    IS_CI=0 \
     CCACHE_DIR=/root/ccache \
     CCACHE_MAXSIZE=30G
 
diff --git a/src/docker/linux/clang-3-6/Dockerfile b/src/docker/linux/clang-3-6/Dockerfile
index 7fc2079..d2aa15b 100644
--- a/src/docker/linux/clang-3-6/Dockerfile
+++ b/src/docker/linux/clang-3-6/Dockerfile
@@ -1,3 +1,17 @@
+# Copyright 2021 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 FROM linux-x64x11-xenial
 
 ARG DEBIAN_FRONTEND=noninteractive
diff --git a/src/docker/linux/evergreen/Dockerfile b/src/docker/linux/evergreen/Dockerfile
index 7abadb3..9880a55a 100644
--- a/src/docker/linux/evergreen/Dockerfile
+++ b/src/docker/linux/evergreen/Dockerfile
@@ -1,9 +1,21 @@
+# Copyright 2021 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 FROM cobalt-build-base
 
 RUN apt update -qqy \
     && apt install -qqy --no-install-recommends \
-        pkgconf ninja-build bison yasm \
-        binutils \
         clang \
         libxml2 \
         binutils-aarch64-linux-gnu \
diff --git a/src/docker/linux/linux-x64x11/Dockerfile b/src/docker/linux/linux-x64x11/Dockerfile
index 93882a2..a3da610 100644
--- a/src/docker/linux/linux-x64x11/Dockerfile
+++ b/src/docker/linux/linux-x64x11/Dockerfile
@@ -1,10 +1,22 @@
+# Copyright 2021 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 ARG FROM_IMAGE
 FROM ${FROM_IMAGE:-cobalt-build-base}
 
 RUN apt update -qqy \
     && apt install -qqy --no-install-recommends \
-        pkgconf ninja-build bison yasm \
-        binutils \
         clang \
         libgles2-mesa-dev \
         mesa-common-dev \
diff --git a/src/docker/linux/raspi/Dockerfile b/src/docker/linux/raspi/Dockerfile
index 46dc6aa..4f103fe 100644
--- a/src/docker/linux/raspi/Dockerfile
+++ b/src/docker/linux/raspi/Dockerfile
@@ -1,3 +1,17 @@
+# Copyright 2021 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 FROM cobalt-build-base
 
 ARG raspi_home=/root/raspi-home
@@ -8,15 +22,10 @@
 
 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/* \
diff --git a/src/docker/linux/stub/Dockerfile b/src/docker/linux/stub/Dockerfile
index 618deba..bf96e84 100644
--- a/src/docker/linux/stub/Dockerfile
+++ b/src/docker/linux/stub/Dockerfile
@@ -1,9 +1,21 @@
+# Copyright 2021 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 FROM cobalt-build-base
 
 RUN apt update -qqy \
     && apt install -qqy --no-install-recommends \
-        pkgconf ninja-build bison yasm \
-        binutils \
         libstdc++-6-dev \
         mesa-common-dev \
         libx11-dev \
diff --git a/src/docker/linux/stub/gn/Dockerfile b/src/docker/linux/stub/gn/Dockerfile
new file mode 100644
index 0000000..8332e58
--- /dev/null
+++ b/src/docker/linux/stub/gn/Dockerfile
@@ -0,0 +1,4 @@
+FROM cobalt-build-linux-stub
+
+CMD gn gen ${OUTDIR}/${PLATFORM}_${CONFIG} --args="target_os=\"${PLATFORM}\" build_type=\"${CONFIG}\"" && \
+    ninja -v -C ${OUTDIR}/${PLATFORM}_${CONFIG}
diff --git a/src/docker/linux/unittest/Dockerfile b/src/docker/linux/unittest/Dockerfile
index e876c8d..c833335 100644
--- a/src/docker/linux/unittest/Dockerfile
+++ b/src/docker/linux/unittest/Dockerfile
@@ -1,3 +1,17 @@
+# Copyright 2021 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 FROM cobalt-base
 
 RUN apt update -qqy \