-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile
51 lines (43 loc) · 2.16 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
ARG BASE_IMAGE=ubuntu:latest
FROM $BASE_IMAGE
# Install required packages.
RUN export DEBIAN_FRONTEND=noninteractive && \
apt update && \
apt upgrade -y && \
apt install -y --no-install-recommends \
git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget \
python3-dev python3-pip python3-setuptools python3-tk python3-wheel \
xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 \
openocd udev usbutils screen
ARG ZEPHYR_SDK_VERSION=0.16.5
# Install the zephyr SDK.
RUN cd /root && \
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION}/zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64_minimal.tar.xz && \
tar -xvf zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64_minimal.tar.xz && \
rm -rf zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64_minimal.tar.xz && \
cd zephyr-sdk-${ZEPHYR_SDK_VERSION} && \
./setup.sh -t arm-zephyr-eabi -h -c
ARG ZEPHYR_VERSION=3.5.0
ENV ZEPHYR_BASE="/root/zephyr-${ZEPHYR_VERSION}"
ENV PATH="/root/.local/bin:${PATH}"
ENV PIP_BREAK_SYSTEM_PACKAGES=1
# Install zephyr at ZEPHYR_BASE.
RUN pip3 install -U west && \
west init -m https://github.com/zephyrproject-rtos/zephyr --mr v${ZEPHYR_VERSION} ${ZEPHYR_BASE} && \
cd ${ZEPHYR_BASE} && \
west update && \
west zephyr-export && \
pip3 install --user -r ${ZEPHYR_BASE}/zephyr/scripts/requirements.txt
# Install JLink. Postpone the post configure.
RUN cd /root && \
wget https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-24-0/nrf-command-line-tools_10.24.0_amd64.deb && \
dpkg -i nrf-command-line-tools_10.24.0_amd64.deb && \
dpkg --unpack /opt/nrf-command-line-tools/share/JLink_Linux_V794e_x86_64.deb && \
mv /var/lib/dpkg/info/jlink.postinst jlink.postinst && \
chmod +x jlink.postinst && \
(dpkg --configure jlink || true) && \
apt install -yf && \
rm -rf nrf-command-line-tools_10.24.0_amd64.deb
# Initialise zephyr on every command prompt.
RUN echo 'source $(find $ZEPHYR_BASE -name zephyr-env.sh)' >> /root/.bashrc
ENTRYPOINT ["entrypoint.sh", "bash"]