Install zap v2022.11.16 in Docker images. (#23643)

* Install zap v2022.11.16 in Docker images.

Installing from a zip file since deb installation seems to add
an entire XWindows dependency and based on feedback from zap
folks the zip file is the one more tested.

* Fix moved line

* Only keep zap-cli in the image. zap is a UI tool, not used and quite large

* Remove node install: zap should be a stand-alone tool

* Remove chip-build-zap because this image is not compatible anymore with missing node.js installation from the base image

* Remove chip-build-zap from chip-build-vscode

* Remove zap image build attempts from CI
diff --git a/.github/workflows/docker_img.yaml b/.github/workflows/docker_img.yaml
index bd3fb57..a0fc677 100644
--- a/.github/workflows/docker_img.yaml
+++ b/.github/workflows/docker_img.yaml
@@ -57,7 +57,6 @@
                     - "-openiotsdk"
                     # NOTE: vscode image consumes ~52 GB disk space but GitHub-hosted runners provide ~10 GB free disk space(https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources)
                     #- "-vscode"
-                    - "-zap"
         steps:
             - uses: Wandalen/wretry.action@v1.0.36
               name: Checkout
diff --git a/integrations/docker/images/chip-build-vscode/Dockerfile b/integrations/docker/images/chip-build-vscode/Dockerfile
index d3c4dc7..ded2dca 100644
--- a/integrations/docker/images/chip-build-vscode/Dockerfile
+++ b/integrations/docker/images/chip-build-vscode/Dockerfile
@@ -13,7 +13,6 @@
 FROM connectedhomeip/chip-build-imx:${VERSION} AS imx
 FROM connectedhomeip/chip-build-ti:${VERSION} AS ti
 FROM connectedhomeip/chip-build-openiotsdk:${VERSION} AS openiotsdk
-FROM connectedhomeip/chip-build-zap:${VERSION} AS zap
 FROM connectedhomeip/chip-build:${VERSION}
 
 # qemu-src copied over because qemu directory contains symlinks to the src
@@ -51,8 +50,6 @@
 COPY --from=openiotsdk /opt/gcc-arm-none-eabi-10.3-2021.10/ /opt/gcc-arm-none-eabi-10.3-2021.10/
 COPY --from=openiotsdk /opt/FVP_Corstone_SSE-300/ /opt/FVP_Corstone_SSE-300/
 
-COPY --from=zap /opt/zap /opt/zap
-
 # Android license file "acceping" is done by writing license hashes
 # into the 'licenses' subfolder. This allows any user (in particular
 # 'vscode' to accept licenses)
diff --git a/integrations/docker/images/chip-build-zap/Dockerfile b/integrations/docker/images/chip-build-zap/Dockerfile
deleted file mode 100644
index 73b199f..0000000
--- a/integrations/docker/images/chip-build-zap/Dockerfile
+++ /dev/null
@@ -1,12 +0,0 @@
-ARG VERSION=latest
-FROM connectedhomeip/chip-build:${VERSION}
-
-ENV ZAP_COMMIT=7ab717d08dfe9b0ba9de907fc7c6eb6549c86bf7
-
-ENV ZAP_ORIGIN=https://github.com/project-chip/zap.git
-
-WORKDIR /opt
-RUN git clone $ZAP_ORIGIN
-WORKDIR ./zap
-RUN git checkout $ZAP_COMMIT
-RUN npm ci
diff --git a/integrations/docker/images/chip-build-zap/README.md b/integrations/docker/images/chip-build-zap/README.md
deleted file mode 100644
index e4d6f14..0000000
--- a/integrations/docker/images/chip-build-zap/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ZAP
-
--   This Dockerfile builds https://github.com/project-chip/zap.git, which gets
-    copied into `chip-build-vscode`
--   ZAP is also a submodule in `third_party/zap/repo`. You can check the commit
-    of ZAP used in the submodule by running
-    `git ls-tree master third_party/zap/repo | awk '{print $3}'` from the
-    repository root.
diff --git a/integrations/docker/images/chip-build-zap/build.sh b/integrations/docker/images/chip-build-zap/build.sh
deleted file mode 120000
index fcb4d4e..0000000
--- a/integrations/docker/images/chip-build-zap/build.sh
+++ /dev/null
@@ -1 +0,0 @@
-../../build.sh
\ No newline at end of file
diff --git a/integrations/docker/images/chip-build-zap/run.sh b/integrations/docker/images/chip-build-zap/run.sh
deleted file mode 120000
index ccbd350..0000000
--- a/integrations/docker/images/chip-build-zap/run.sh
+++ /dev/null
@@ -1 +0,0 @@
-../../run.sh
\ No newline at end of file
diff --git a/integrations/docker/images/chip-build-zap/version b/integrations/docker/images/chip-build-zap/version
deleted file mode 120000
index a4280ac..0000000
--- a/integrations/docker/images/chip-build-zap/version
+++ /dev/null
@@ -1 +0,0 @@
-../chip-build/version
\ No newline at end of file
diff --git a/integrations/docker/images/chip-build/Dockerfile b/integrations/docker/images/chip-build/Dockerfile
index d53978c..ea1360a 100644
--- a/integrations/docker/images/chip-build/Dockerfile
+++ b/integrations/docker/images/chip-build/Dockerfile
@@ -6,7 +6,7 @@
 # base build and check tools and libraries layer
 RUN set -x \
     && apt-get update \
-    && DEBIAN_FRONTEND=noninteractive apt-get install -fy \
+    && DEBIAN_FRONTEND=noninteractive apt-get install -fy --fix-missing \
     autoconf \
     automake \
     bison \
@@ -19,12 +19,14 @@
     flex \
     g++ \
     git \
+    git-lfs \
     gperf \
     iproute2 \
     jq \
     lcov \
     libavahi-client-dev \
     libavahi-common-dev \
+    libcairo-dev \
     libcairo2-dev \
     libdbus-1-dev \
     libdbus-glib-1-dev \
@@ -42,6 +44,7 @@
     libpango1.0-dev \
     libpixman-1-dev \
     libreadline-dev \
+    libsdl-pango-dev \
     libssl-dev \
     libtool \
     libudev-dev \
@@ -64,7 +67,6 @@
     udev \
     unzip \
     wget \
-    git-lfs \
     zlib1g-dev \
     && rm -rf /var/lib/apt/lists/ \
     && git lfs install \
@@ -118,21 +120,6 @@
     && rm -rf bloaty \
     && : # last line
 
-# NodeJS: install a newer version than what apt-get would read
-# This installs the latest LTS version of nodejs
-ENV CHIP_NODE_VERSION=v16.13.2
-RUN set -x \
-    && mkdir node_js \
-    && cd node_js \
-    && wget https://nodejs.org/dist/$CHIP_NODE_VERSION/node-$CHIP_NODE_VERSION-linux-x64.tar.xz \
-    && tar xfvJ node-$CHIP_NODE_VERSION-linux-x64.tar.xz \
-    && mv node-$CHIP_NODE_VERSION-linux-x64 /opt/ \
-    && ln -s /opt/node-$CHIP_NODE_VERSION-linux-x64 /opt/node \
-    && ln -s /opt/node/bin/* /usr/bin \
-    && cd .. \
-    && rm -rf node_js \
-    && : # last line
-
 # Build glib-2.0 from source with enabled thread sanitizer. This is needed for
 # running CHIP tests with TSAN enabled. When running applications with TSAN
 # all shared libraries should be built with TSAN enabled, otherwise TSAN might
@@ -148,3 +135,16 @@
     && mv glib/build-image/usr/local/lib/x86_64-linux-gnu/lib* $LD_LIBRARY_PATH_TSAN \
     && rm -rf glib \
     && : # last line
+
+# Install a known ZAP release
+# Only keep the cli version, since `zap` is 143MB and not usable (UI)
+ENV ZAP_VERSION=v2022.11.16
+RUN set -x \
+    && mkdir -p /opt/zap-${ZAP_VERSION} \
+    && cd /opt/zap-${ZAP_VERSION} \
+    && wget https://github.com/project-chip/zap/releases/download/${ZAP_VERSION}/zap-linux.zip \
+    && unzip zap-linux.zip \
+    && rm zap-linux.zip \
+    && rm zap \
+    && ln -s /opt/zap-${ZAP_VERSION}/zap /usr/bin/ \
+    && : # last line
diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version
index 20f61fa..70fadae 100644
--- a/integrations/docker/images/chip-build/version
+++ b/integrations/docker/images/chip-build/version
@@ -1 +1 @@
-0.6.08 Version bump reason: Update ESP-IDF to v4.4.3 release
+0.6.09 Version bump reason: Install zap v2022.11.16 in docker images.