# @license # Copyright 2022-2026 Matter.js Authors # SPDX-License-Identifier: Apache-2.0 # Builds an image capable of running chip-tool and CHIP tests. # # Intermediate stages don't focus on optimization but the final image is minimal (relatively speaking). ################################################################################ # # STAGE 1 - common base image # # Includes just a few small tweaks on base Ubuntu # FROM ubuntu:24.04 AS base SHELL [ "/bin/bash", "-c" ] # Quality of life RUN echo 'PS1="\[\033[01;32m\]matter.js-chip\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m# "' >> /root/.bashrc # Set timezone to UTC ENV TZ=Etc/UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone # Install a few packages required by final image and build RUN --mount=type=cache,sharing=locked,target=/var/cache/apt \ --mount=type=cache,sharing=locked,target=/var/lib/apt \ apt-get -qq update && \ apt-get -qq -y install python3 python-is-python3 libavahi-client3 libglib2.0-0 libpcsclite1 libevent-dev \ libgstreamer1.0-0 libgstreamer-plugins-base1.0-0 libavformat60 libavcodec60 libavutil58 libcurl4 \ gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly ################################################################################ # # STAGE 2 - OS build tooling # FROM --platform=$BUILDPLATFORM base AS build ARG TARGETPLATFORM # Validate platform (must be amd64 or arm64) RUN </test_case_vector.json`) COPY --from=source /connectedhomeip/credentials/development/commissioner_dut /credentials/development/commissioner_dut # Idempotent: the media packages above pull in dbus, whose own install creates this directory RUN mkdir -p /run/dbus # Summarize tests for efficient metadata load at runtime COPY support/generate-test-descriptor /bin/generate-test-descriptor RUN generate-test-descriptor > /lib/test-descriptor.json # Install extra PICS files RUN mkdir -p examples/rvc-app/rvc-common/pics COPY --from=source \ /connectedhomeip/examples/rvc-app/rvc-common/pics/rvc-app-pics-values \ /examples/rvc-app/rvc-common/pics/rvc-app-pics-values # Install MDNS scripts COPY support/mdns-* /bin # Include CHIP SHA for diagnostic purposes COPY --from=source /etc/chip-version /etc # Configure avahi RUN echo allow-interfaces