Ubuntu 22.04 (Docker) 构建 OP-TEE
Dockerfile 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractiveENV TZ=Europe/StockholmRUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update RUN apt-get -y --allow-downgrades --allow-remove-essential --allow-change-held-packages install apt-utils RUN apt-get -y --allow-downgrades --allow-remove-essential --allow-change-held-packages install \ adb \ acpica-tools \ autoconf \ automake \ bc \ bison \ build-essential \ ccache \ cscope \ curl \ device-tree-compiler \ expect \ fastboot \ flex \ ftp-upload \ gdisk \ libattr1-dev \ libcap-dev \ libcap-ng-dev \ libfdt-dev \ libftdi-dev \ libglib2.0-dev \ libgmp3-dev \ libhidapi-dev \ libmpc-dev \ libncurses5-dev \ libpixman-1-dev \ libssl-dev \ libtool \ make \ mtools \ netcat \ ninja-build \ python3-cryptography \ python3-pip \ python3-pyelftools \ python3-serial \ python-is-python3 \ rsync \ unzip \ uuid-dev \ xdg-utils \ xterm \ xz-utils \ zlib1g-dev \ curl \ cpio \ git \ wget \ vim RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /bin/repo RUN chmod a+x /bin/repo RUN useradd --shell /bin/bash -u 1000 -o -c "" -m optee RUN echo 'optee:optee' | chpasswd RUN mkdir -p /home/optee/qemu-optee ADD launch_optee.sh /home/optee/qemu-optee/launch_optee.sh RUN chown -R optee:optee /home/optee/qemu-optee RUN apt-get -y --allow-downgrades --allow-remove-essential --allow-change-held-packages install locales RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen ENV LANG=en_US.UTF-8 ENV LANGUAGE=en_US:enENV LC_ALL=en_US.UTF-8 RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* USER opteeenv USE_CCACHE=1 env CCACHE_DIR=/home/optee/.ccacheenv CCACHE_UMASK=002 RUN mkdir -p /home/optee/buildroot_dl env BR2_DL_DIR=/home/optee/buildroot_dlRUN git config --global user.name "OP-TEE" RUN git config --global user.email "op-tee@linaro.org" env TERM=rxvt-256 colorWORKDIR /home/optee/qemu-optee RUN chmod a+x launch_optee.sh WORKDIR /home/optee/qemu-optee RUN repo init -u https://github.com/OP-TEE/manifest.git -m qemu_v8.xml && repo sync -j10 WORKDIR /home/optee/qemu-optee/build RUN make -j2 toolchains RUN make -j$(nproc ) check CMD make -j$(nproc ) run
构建
启动 1 docker run --name optee -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix optee
退出后重新启动 1 2 docker start optee docker attach optee
References