Skip to content

Commit dc6fcad

Browse files
committed
Update Dockerfile for Zephyr SDK and Zephyr-project versioning
Use a minimum mainfest to reduce time consumption
1 parent 602e86a commit dc6fcad

File tree

3 files changed

+48
-15
lines changed

3 files changed

+48
-15
lines changed
Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
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.
36
FROM ubuntu:22.04
47

58
ARG DEBIAN_FRONTEND=noninteractive
69
ENV TZ=Asian/Shanghai
10+
ARG ZEPHYR_SDK_VERSION=0.16.9
11+
# In west_lite.yml, the Zephyr version is set to v3.7.0
12+
#ARG ZEPHYR_VERSION=3.7.0
713

814
# Install dependencies for Zephyr
915
# hadolint ignore=DL3008
@@ -16,28 +22,34 @@ RUN apt-get update && apt-get install -y --no-install-recommends git cmake ninja
1622
# Install the Zephyr Software Development Kit (SDK)
1723
WORKDIR /opt
1824
# 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
25+
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 \
26+
&& wget --progress=dot:giga -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION}/sha256.sum | shasum --check --ignore-missing \
27+
&& tar xf zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64.tar.xz && rm zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64.tar.xz
2228

23-
WORKDIR /opt/zephyr-sdk-0.16.3
29+
WORKDIR /opt/zephyr-sdk-${ZEPHYR_SDK_VERSION}
2430
# hadolint ignore=DL4006
25-
RUN yes | ./setup.sh
31+
# Install host tools and Register Zephyr SDK CMake package
32+
RUN ./setup.sh -h -c
2633

2734
# Get Zephyr
35+
WORKDIR /root/zephyrproject/smoke-test
36+
2837
# 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
38+
RUN pip3 install --no-cache-dir west
39+
COPY ./west_lite.yml ./west.yml
3040

31-
WORKDIR /root/zephyrproject
32-
RUN west update
41+
# init the west workspace with a minimal manifest
42+
RUN west init -l
3343

34-
WORKDIR /root/zephyrproject/zephyr
35-
RUN west zephyr-export && pip install --no-cache-dir -r ~/zephyrproject/zephyr/scripts/requirements.txt
44+
WORKDIR /root/zephyrproject
45+
RUN west update --stats
3646

37-
# Git clone wamr
38-
WORKDIR /root
39-
RUN git clone https://github.com/bytecodealliance/wasm-micro-runtime.git
47+
WORKDIR /root/zephyrproject/modules/zephyr
48+
RUN west zephyr-export && pip install --no-cache-dir -r ./scripts/requirements.txt
4049

41-
WORKDIR /root/wasm-micro-runtime/product-mini/platforms/zephyr/simple
50+
ENV ZEPHYR_BASE="/root/zephyrproject/modules/zephyr"
4251

43-
ENV ZEPHYR_BASE="/root/zephyrproject/zephyr"
52+
# Git clone wamr
53+
WORKDIR /root/zephyrproject/modules/
54+
RUN git clone https://github.com/bytecodealliance/wasm-micro-runtime.git wasm-micro-runtime
55+
WORKDIR /root/zephyrproject/modules/wasm-micro-runtime/product-mini/platforms/zephyr

product-mini/platforms/zephyr/simple/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ is a 64-bit ARM target for emulating the Cortex-A53 platform.
8787
west build . -b qemu_cortex_a53 -p always -- -DWAMR_BUILD_TARGET=AARCH64
8888
```
8989

90+
[ARC QEMU](https://docs.zephyrproject.org/latest/boards/qemu/arc/doc/index.html)
91+
is a 32-bit ARC target for emulating the ARC platform.
92+
93+
```shell
94+
west build . -b qemu_arc/qemu_arc_em -p always -- -DWAMR_BUILD_TARGET=ARC
95+
```
9096

9197
## Flashing or Running Image
9298

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# The west manifest file for WAMR on Zephyr smoke test.
2+
#
3+
manifest:
4+
#
5+
# Please add items below based on alphabetical order
6+
projects:
7+
- name: zephyr
8+
url: https://github.com/zephyrproject-rtos/zephyr
9+
revision: v3.7.0
10+
clone-depth: 1
11+
path: modules/zephyr
12+
west-commands: scripts/west-commands.yml
13+
14+
self:
15+
path: smoke-test

0 commit comments

Comments
 (0)