-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-v40
64 lines (52 loc) · 3.24 KB
/
Dockerfile-v40
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
FROM ubuntu:18.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
apt-utils bison ca-certificates ccache check cmake \
curl flex git gperf lcov libncurses-dev libusb-1.0-0-dev \
locales make nano ninja-build python3 python3-pip \
rsync unzip vim wget xz-utils zip \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 10
RUN locale-gen en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
RUN python -m pip install --upgrade pip virtualenv
COPY shallow_clone /usr/bin/
ENV IDF_TOOLS_PATH=/opt/esp
ENV IDF_PATH=/opt/esp/idf
ENV LIB_BUILDER_PATH=/opt/esp/lib-builder
ENV NO_GIT=1
RUN shallow_clone https://github.com/espressif/esp-idf 08219f3cf5689e5d0f6c8a0f150c842237b92271 $IDF_PATH
# tinydtls has made the shallow pull fail
RUN cd $IDF_PATH && git submodule update --progress --depth 1 --init --recursive \
; rm $IDF_PATH/components/expat/expat/testdata/largefiles/* \
&& if [ $NO_GIT ]; then \
rm -rf $IDF_PATH/.git && find $IDF_PATH -name .git -delete; fi
RUN cd $IDF_PATH/components/coap/libcoap/ext \
&& rm -rf tinydtls && git clone https://github.com/eclipse/tinydtls \
&& cd tinydtls && git checkout 3b24a701ed5b0785306aa732e739ecb1eb3d03f8 \
&& if [ $NO_GIT ]; then \
rm -rf $IDF_PATH/components/coap/libcoap/ext/tinydtls/.git; fi
RUN sed -i "s/'--no-site-packages',//" $IDF_PATH/tools/idf_tools.py \
&& $IDF_PATH/install.sh \
&& rm -rf /root/.cache /root/.local \
&& rm -rf /opt/esp/dist
RUN shallow_clone https://github.com/espressif/esp32-arduino-lib-builder release/v4.0 $LIB_BUILDER_PATH \
&& sed -i '40s|^|source tools/config.sh\n\n|;41,46{s/^/#/}' $LIB_BUILDER_PATH/build.sh \
&& sed -i 's|.*make.*|idf.py build\ntools/prepare-libs.sh|' $LIB_BUILDER_PATH/tools/build-libs.sh \
&& sed -i 's|AR_INC=|rsync -amv $IDF_PATH/components/ out/tools/sdk/include/ --include "*/" --include "*.h" --exclude "*"\nAR_INC=|' $LIB_BUILDER_PATH/tools/prepare-libs.sh \
&& sed 's/blink/lib-builder/' $IDF_PATH/examples/get-started/blink/CMakeLists.txt > $LIB_BUILDER_PATH/CMakeLists.txt \
&& if [ $NO_GIT ]; then rm -rf .git; fi
RUN shallow_clone https://github.com/espressif/arduino-esp32 idf-release/v4.0 $LIB_BUILDER_PATH/components/arduino \
&& cp $LIB_BUILDER_PATH/components/arduino/tools/sdk/sdkconfig $LIB_BUILDER_PATH \
&& rm -rf $LIB_BUILDER_PATH/components/arduino/tools/sdk
RUN sed -i "/setup()/d ; /loop()/d" $LIB_BUILDER_PATH/components/arduino/cores/esp32/main.cpp \
&& if [ $NO_GIT ]; then rm -rf $LIB_BUILDER_PATH/components/arduino/.git; fi
RUN shallow_clone https://github.com/espressif/esp32-camera/ 452df1d0d151821fc724c561d261593053f43ef3 $LIB_BUILDER_PATH/components/esp32-camera \
&& if [ $NO_GIT ]; then rm -rf $LIB_BUILDER_PATH/components/camera/.git; fi
RUN shallow_clone https://github.com/espressif/esp-face/ b4a2ef17043b5d62564cdb71d190d1f36f38f171 $LIB_BUILDER_PATH/components/esp-face \
&& if [ $NO_GIT ]; then rm -rf $LIB_BUILDER_PATH/components/esp-face/.git; fi
RUN echo "PATH=$IDF_TOOLS_PATH/xtensa-esp32-elf/bin:$PATH\n \
cd $LIB_BUILDER_PATH\n \
source $IDF_PATH/export.sh &> /dev/null" >> /root/.bashrc