-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile.esp32
66 lines (56 loc) · 1.61 KB
/
Dockerfile.esp32
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
FROM debian:bookworm-20240926-slim
ARG GIT_TAG
ENV ARDUINO_VERSION="1.8.19"
ENV GIT_TAG=${GIT_TAG}
ENV DEBIAN_FRONTEND=noninteractive
ENV ESP32_VERSION="3.0.7"
RUN apt -y -qq update && \
apt -y -qq --no-install-recommends --allow-change-held-packages install \
software-properties-common \
wget \
zip \
git \
make \
srecord \
bc \
xz-utils \
gcc \
curl \
xvfb \
python3 \
python3-dev \
python3-pip \
build-essential \
libncurses-dev \
flex \
bison \
gperf \
libxrender1 \
libxtst6 \
libxi6 \
jq \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /opt
# Get pinned version of Arduino IDE
RUN curl https://downloads.arduino.cc/arduino-$ARDUINO_VERSION-linux64.tar.xz > ./arduino-$ARDUINO_VERSION-linux64.tar.xz \
&& unxz -q ./arduino-$ARDUINO_VERSION-linux64.tar.xz \
&& tar -xvf arduino-$ARDUINO_VERSION-linux64.tar \
&& rm -rf arduino-$ARDUINO_VERSION-linux64.tar \
&& mv ./arduino-$ARDUINO_VERSION ./arduino \
&& cd ./arduino \
&& ./install.sh
# Get latest ESP32 Arduino framework
WORKDIR /opt/arduino/hardware/espressif
RUN git clone --branch $ESP32_VERSION https://github.com/espressif/arduino-esp32.git esp32
WORKDIR /opt/arduino/hardware/espressif/esp32
RUN git submodule update --init --recursive \
&& rm -rf ./**/examples/** ./.git
# Get ESP32 tools
WORKDIR /opt/arduino/hardware/espressif/esp32/tools
RUN ls -la && python3 --version && python3 get.py
# Hardening and optimization: clean apt lists
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN mkdir /opt/workspace
WORKDIR /opt/workspace
COPY cmd.sh /opt/
CMD [ "/opt/cmd.sh" ]