-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
89 lines (74 loc) · 2.35 KB
/
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
FROM ubuntu:22.04
# Set the working directory to /home
WORKDIR /zephyr-workdir
# Set environment variables
ENV ARM_TOOLCHAINS_URL=https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.4/toolchain_linux-x86_64_arm-zephyr-eabi.tar.xz
ENV ARM_TOOLCHAINS_FILENAME=toolchain_linux-x86_64_arm-zephyr-eabi.tar.xz
ENV ZEPHYR_SDK_URL_MINIMAL=https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.4/zephyr-sdk-0.16.4_linux-x86_64_minimal.tar.xz
ENV ZEPHYR_SDK_TAR_FILENAME=zephyr-sdk-0.16.4_linux-x86_64_minimal.tar.xz
ENV ZEPHYR_SDK_FOLDER=zephyr-sdk-0.16.4
# Install base dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
tar \
perl \
xz-utils \
python3 \
python3-pip \
git \
file \
make \
gcc \
cmake \
ninja-build \
gperf \
device-tree-compiler \
ccache \
dfu-util \
python3-setuptools \
python3-wheel \
python3-venv \
sudo
# Download and install Zephyr SDK minimal
RUN wget $ZEPHYR_SDK_URL_MINIMAL -O /opt/$ZEPHYR_SDK_TAR_FILENAME
# Download and install ARM toolchains
RUN wget $ARM_TOOLCHAINS_URL -O /opt/$ARM_TOOLCHAINS_FILENAME
# Install Zephyr SDK
RUN cd /opt/ && tar xf ./$ZEPHYR_SDK_TAR_FILENAME && \
bash ./$ZEPHYR_SDK_FOLDER/setup.sh -h -c -t arm-zephyr-eabi
# Create virtual environment
RUN python3 -m venv venv && \
# Upgrade pip
python3 -m pip install -U pip
# Install west
RUN . venv/bin/activate && \
pip install west
# Initialize west
RUN . venv/bin/activate && \
west init -m https://github.com/IonicHealthUsa/zephyr --mr v3.4.0-custom-kernel
# Update west
RUN . venv/bin/activate && \
west update && \
# Export Zephyr SDK
west zephyr-export
# Install Zephyr dependencies
RUN . venv/bin/activate && \
pip install -r ./zephyr/scripts/requirements.txt
# Clone mcuboot
RUN git clone https://github.com/mcu-tools/mcuboot.git && \
(cd mcuboot/ && git checkout v1.10.0) && \
. venv/bin/activate && \
# Install mcuboot dependencies
pip install -r ./mcuboot/scripts/requirements.txt && \
# Cleanup
apt-get remove -y --purge \
python3-dev \
python3-pip \
python3-setuptools \
python3-wheel \
wget \
xz-utils && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -f /opt/$ZEPHYR_SDK_TAR_FILENAME && \
rm -f /opt/$ARM_TOOLCHAINS_FILENAME