# OP-TEE QEMU 验证的构建环境（armv7 vexpress-qemu_virt）
#
# 只用于 B2 门禁验证：交叉编译 optee_os / optee_client / optee_test，
# 并在容器内跑 qemu-system-arm。产物挂到 optee/.build/（不入库）。
#
# 构建： docker build -t optee-qemu:22.04 optee/docker
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8

RUN apt-get update && apt-get install -y --no-install-recommends \
        build-essential \
        gcc-arm-linux-gnueabihf \
        libc6-dev-armhf-cross \
        git ca-certificates curl wget \
        file unzip xz-utils cpio rsync patch perl \
        bison flex bc \
        python3 python3-dev python3-setuptools python3-pyelftools \
        python3-cryptography \
        device-tree-compiler \
        libssl-dev libncurses-dev zlib1g-dev \
        qemu-system-arm \
    && rm -rf /var/lib/apt/lists/*

# 交叉编译器自检：镜像坏了要尽早失败
RUN arm-linux-gnueabihf-gcc --version | head -1 \
    && qemu-system-arm --version | head -1

WORKDIR /work
