-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
89 lines (69 loc) · 2.59 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 debian:bookworm
ARG DEBIAN_FRONTEND=noninteractive
ARG GCC_ARM_VERSION="12.3.rel1"
ARG ZAP_TOOL_RELEASE="v2023.12.07"
ARG GECKO_SDK_VERSION="v4.4.0"
ARG USERNAME=builder
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
bzip2 \
curl \
git \
git-lfs \
jq \
libgl1 \
make \
default-jre-headless \
patch \
python3 \
unzip \
xz-utils \
less \
&& apt-get clean
# Install Simplicity Commander (unfortunately no stable URL available, this
# is known to be working with Commander_linux_x86_64_1v15p0b1306.tar.bz).
RUN \
curl -O https://www.silabs.com/documents/login/software/SimplicityCommander-Linux.zip \
&& unzip SimplicityCommander-Linux.zip \
&& tar -C /opt -xjf SimplicityCommander-Linux/Commander_linux_x86_64_*.tar.bz \
&& rm -r SimplicityCommander-Linux \
&& rm SimplicityCommander-Linux.zip
ENV PATH="$PATH:/opt/commander"
# Install Silicon Labs Configurator (slc)
RUN \
curl -O https://www.silabs.com/documents/login/software/slc_cli_linux.zip \
&& unzip -d /opt slc_cli_linux.zip \
&& chmod go-w /opt/slc_cli \
&& rm slc_cli_linux.zip
ENV PATH="$PATH:/opt/slc_cli"
# Install ARM GCC embedded toolchain
RUN \
curl -L -O https://developer.arm.com/-/media/Files/downloads/gnu/${GCC_ARM_VERSION}/binrel/arm-gnu-toolchain-${GCC_ARM_VERSION}-x86_64-arm-none-eabi.tar.xz \
&& xzcat arm-gnu-toolchain-${GCC_ARM_VERSION}-x86_64-arm-none-eabi.tar.xz | tar -C /opt -xf -\
&& rm arm-gnu-toolchain-${GCC_ARM_VERSION}-x86_64-arm-none-eabi.tar.xz
ENV PATH="$PATH:/opt/arm-gnu-toolchain-${GCC_ARM_VERSION}-x86_64-arm-none-eabi/bin"
# Install ZAP adapter
RUN \
curl -OL https://github.com/project-chip/zap/releases/download/${ZAP_TOOL_RELEASE}/zap-linux-x64.zip \
&& umask 022 \
&& unzip -d /opt/zap zap-linux-x64.zip \
&& rm zap-linux-x64.zip
ENV STUDIO_ADAPTER_PACK_PATH="/opt/zap:/opt/commander"
ENV POST_BUILD_EXE="/opt/commander/commander"
RUN \
git clone --depth 1 -b ${GECKO_SDK_VERSION} \
https://github.com/SiliconLabs/gecko_sdk.git \
&& chmod 755 /gecko_sdk/protocol/zigbee/tool/image-builder/image-builder-linux
# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
USER $USERNAME
WORKDIR /build
RUN \
slc configuration --sdk="/gecko_sdk/" \
&& slc signature trust --sdk "/gecko_sdk/" \
&& slc configuration \
--gcc-toolchain="/opt/arm-gnu-toolchain-${GCC_ARM_VERSION}-x86_64-arm-none-eabi/"