11# Copyright (C) 2019 Intel Corporation. All rights reserved.
22# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+ # Refer to https://docs.zephyrproject.org/3.7.0/develop/getting_started/index.html
5+ # for more information on how to set up the Zephyr development environment.
36FROM ubuntu:22.04
47
58ARG DEBIAN_FRONTEND=noninteractive
69ENV TZ=Asian/Shanghai
10+ ARG ZEPHYR_SDK_VERSION=0.16.9
11+ ARG ZEPHYR_VERSION=3.7.0
712
813# Install dependencies for Zephyr
914# hadolint ignore=DL3008
@@ -16,28 +21,33 @@ RUN apt-get update && apt-get install -y --no-install-recommends git cmake ninja
1621# Install the Zephyr Software Development Kit (SDK)
1722WORKDIR /opt
1823# hadolint ignore=DL4006
19- RUN wget --progress=dot:giga https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.3 /zephyr-sdk-0.16.3_linux -x86_64.tar.xz \
20- && wget --progress=dot:giga -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.3 /sha256.sum | shasum --check --ignore-missing \
21- && tar xvf zephyr-sdk-0.16.3_linux -x86_64.tar.xz && rm zephyr-sdk-0.16.3_linux -x86_64.tar.xz
24+ 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 \
25+ && wget --progress=dot:giga -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION} /sha256.sum | shasum --check --ignore-missing \
26+ && tar xf zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux -x86_64.tar.xz && rm zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux -x86_64.tar.xz
2227
23- WORKDIR /opt/zephyr-sdk-0.16.3
28+ WORKDIR /opt/zephyr-sdk-${ZEPHYR_SDK_VERSION}
2429# hadolint ignore=DL4006
25- RUN yes | ./setup.sh
30+ # Install host tools and Register Zephyr SDK CMake package
31+ RUN ./setup.sh -h -c
2632
2733# Get Zephyr
2834# hadolint ignore=DL3013
29- RUN pip3 install --no-cache-dir west && west init -m https://github.com/zephyrproject-rtos/zephyr --mr v3.5.0 /root/zephyrproject
35+ RUN pip3 install --no-cache-dir west
36+
37+ WORKDIR /root/zephyrproject/smoke-test
38+ COPY ./west_lite.yml ./west.yml
39+ # init the west workspace with a minimal manifest
40+ RUN west init -l
3041
3142WORKDIR /root/zephyrproject
32- RUN west update
43+ RUN west update --stats
3344
34- WORKDIR /root/zephyrproject/zephyr
35- RUN west zephyr-export && pip install --no-cache-dir -r ~/zephyrproject/zephyr /scripts/requirements.txt
45+ WORKDIR /root/zephyrproject/modules/ zephyr
46+ RUN west zephyr-export && pip install --no-cache-dir -r . /scripts/requirements.txt
3647
37- # Git clone wamr
38- WORKDIR /root
39- RUN git clone https://github.com/bytecodealliance/wasm-micro-runtime.git
48+ ENV ZEPHYR_BASE="/root/zephyrproject/modules/zephyr"
4049
41- WORKDIR /root/wasm-micro-runtime/product-mini/platforms/zephyr/simple
42-
43- ENV ZEPHYR_BASE="/root/zephyrproject/zephyr"
50+ # Git clone wamr
51+ WORKDIR /root/zephyrproject/modules/
52+ RUN git clone https://github.com/bytecodealliance/wasm-micro-runtime.git wasm-micro-runtime
53+ WORKDIR /root/zephyrproject/modules/wasm-micro-runtime/product-mini/platforms/zephyr
0 commit comments