1
- # There are a few Dockerfile restrictions when using Github Actions
2
- # See: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions
3
-
1
+ # Base image
4
2
FROM debian:bookworm-slim
5
3
ENV DEBIAN_FRONTEND=noninteractive
6
4
ENV LC_ALL=C.UTF-8
7
5
ENV LANG=C.UTF-8
6
+
7
+ # Arguments
8
8
ARG CONTAINER_USER=esp
9
9
ARG CONTAINER_GROUP=esp
10
10
ARG NIGHTLY_VERSION=nightly-2023-02-28
11
11
ARG ESP_IDF_VERSION=v4.4.4
12
12
ARG ESP_BOARD=esp32c3
13
13
14
+ # Install dependencies
14
15
RUN apt-get update \
15
- && apt-get install -y git curl ninja-build llvm-dev libclang-dev \
16
+ && apt-get install -y git curl ninja-build llvm-dev libclang-dev libusb-1.0-0 \
16
17
clang unzip python3 python3-pip python3-venv libpython3-all-dev python3-virtualenv pkg-config libssl-dev \
17
18
&& apt-get clean -y \
18
19
&& rm -rf /var/lib/apt/lists/* /tmp/library-scripts
19
20
21
+ # Set users
20
22
RUN adduser --disabled-password --gecos "" ${CONTAINER_USER}
21
23
USER ${CONTAINER_USER}
22
24
WORKDIR /home/${CONTAINER_USER}
23
25
26
+ # Install rustup
24
27
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
25
28
--default-toolchain ${NIGHTLY_VERSION} -y --profile minimal \
26
- --component rust-src,clippy
29
+ --component rust-src,clippy,rustfmt
27
30
31
+ # Update envs
28
32
ENV PATH=${PATH}:$HOME/.cargo/bin
29
33
34
+ # Install extra crates
30
35
RUN ARCH=$($HOME/.cargo/bin/rustup show | grep "Default host" | sed -e 's/.* //' ) && \
31
36
curl -L "https://github.com/esp-rs/espflash/releases/latest/download/cargo-espflash-${ARCH}.zip" -o "${HOME}/.cargo/bin/cargo-espflash.zip" && \
32
37
unzip "${HOME}/.cargo/bin/cargo-espflash.zip" -d "${HOME}/.cargo/bin/" && \
@@ -51,6 +56,7 @@ RUN ARCH=$($HOME/.cargo/bin/rustup show | grep "Default host" | sed -e 's/.* //'
51
56
rm "${HOME}/.cargo/bin/cargo-generate.tar.gz" && \
52
57
chmod u+x "${HOME}/.cargo/bin/cargo-generate"
53
58
59
+ # Install esp-idf
54
60
RUN mkdir -p ${HOME}/.espressif/frameworks/ \
55
61
&& git clone --branch ${ESP_IDF_VERSION} -q --depth 1 --shallow-submodules \
56
62
--recursive https://github.com/espressif/esp-idf.git \
@@ -63,6 +69,7 @@ RUN mkdir -p ${HOME}/.espressif/frameworks/ \
63
69
&& rm -rf .espressif/frameworks/esp-idf/tools/esp_app_trace \
64
70
&& rm -rf .espressif/frameworks/esp-idf/tools/test_idf_size
65
71
72
+ # Activate ESP environment
66
73
ENV IDF_TOOLS_PATH=${HOME}/.espressif
67
74
RUN echo "source ${HOME}/.espressif/frameworks/esp-idf/export.sh > /dev/null 2>&1" >> ~/.bashrc
68
75
0 commit comments