Dockerfile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. # Refer to https://docs.zephyrproject.org/3.7.0/develop/getting_started/index.html
  4. # for more information on how to set up the Zephyr development environment.
  5. FROM ubuntu:22.04
  6. ARG DEBIAN_FRONTEND=noninteractive
  7. ENV TZ=Asian/Shanghai
  8. ARG ZEPHYR_SDK_VERSION=0.16.9
  9. # In west_lite.yml, the Zephyr version is set to v3.7.0
  10. #ARG ZEPHYR_VERSION=3.7.0
  11. # Install dependencies for Zephyr
  12. # hadolint ignore=DL3008
  13. RUN apt-get update && apt-get install -y --no-install-recommends git cmake ninja-build gperf \
  14. ccache dfu-util device-tree-compiler wget \
  15. python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
  16. make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 \
  17. && apt-get clean -y && rm -rf /var/lib/apt/lists/*
  18. # Install the Zephyr Software Development Kit (SDK)
  19. WORKDIR /opt
  20. # hadolint ignore=DL4006
  21. RUN wget --progress=dot:giga https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION}/zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64.tar.xz \
  22. && wget --progress=dot:giga -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION}/sha256.sum | shasum --check --ignore-missing \
  23. && tar xf zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64.tar.xz && rm zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64.tar.xz
  24. WORKDIR /opt/zephyr-sdk-${ZEPHYR_SDK_VERSION}
  25. # hadolint ignore=DL4006
  26. # Install host tools and Register Zephyr SDK CMake package
  27. RUN ./setup.sh -h -c
  28. # Get Zephyr
  29. WORKDIR /root/zephyrproject/smoke-test
  30. # hadolint ignore=DL3013
  31. RUN pip3 install --no-cache-dir west
  32. COPY ./west_lite.yml ./west.yml
  33. # init the west workspace with a minimal manifest
  34. RUN west init -l
  35. WORKDIR /root/zephyrproject
  36. RUN west update --stats
  37. WORKDIR /root/zephyrproject/modules/zephyr
  38. RUN west zephyr-export && pip install --no-cache-dir -r ./scripts/requirements.txt
  39. ENV ZEPHYR_BASE="/root/zephyrproject/modules/zephyr"
  40. # Git clone wamr
  41. WORKDIR /root/zephyrproject/modules/
  42. RUN git clone https://github.com/bytecodealliance/wasm-micro-runtime.git wasm-micro-runtime
  43. WORKDIR /root/zephyrproject/modules/wasm-micro-runtime/product-mini/platforms/zephyr