Skip to content

Commit 57369a2

Browse files
committed
build: Update deps and rust components
1 parent a642a2a commit 57369a2

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.devcontainer/Dockerfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,37 @@
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
42
FROM debian:bookworm-slim
53
ENV DEBIAN_FRONTEND=noninteractive
64
ENV LC_ALL=C.UTF-8
75
ENV LANG=C.UTF-8
6+
7+
# Arguments
88
ARG CONTAINER_USER=esp
99
ARG CONTAINER_GROUP=esp
1010
ARG NIGHTLY_VERSION=nightly-2023-02-28
1111
ARG ESP_IDF_VERSION=v4.4.4
1212
ARG ESP_BOARD=esp32c3
1313

14+
# Install dependencies
1415
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\
1617
clang unzip python3 python3-pip python3-venv libpython3-all-dev python3-virtualenv pkg-config libssl-dev \
1718
&& apt-get clean -y \
1819
&& rm -rf /var/lib/apt/lists/* /tmp/library-scripts
1920

21+
# Set users
2022
RUN adduser --disabled-password --gecos "" ${CONTAINER_USER}
2123
USER ${CONTAINER_USER}
2224
WORKDIR /home/${CONTAINER_USER}
2325

26+
# Install rustup
2427
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
2528
--default-toolchain ${NIGHTLY_VERSION} -y --profile minimal \
26-
--component rust-src,clippy
29+
--component rust-src,clippy,rustfmt
2730

31+
# Update envs
2832
ENV PATH=${PATH}:$HOME/.cargo/bin
2933

34+
# Install extra crates
3035
RUN ARCH=$($HOME/.cargo/bin/rustup show | grep "Default host" | sed -e 's/.* //') && \
3136
curl -L "https://github.com/esp-rs/espflash/releases/latest/download/cargo-espflash-${ARCH}.zip" -o "${HOME}/.cargo/bin/cargo-espflash.zip" && \
3237
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/.* //'
5156
rm "${HOME}/.cargo/bin/cargo-generate.tar.gz" && \
5257
chmod u+x "${HOME}/.cargo/bin/cargo-generate"
5358

59+
# Install esp-idf
5460
RUN mkdir -p ${HOME}/.espressif/frameworks/ \
5561
&& git clone --branch ${ESP_IDF_VERSION} -q --depth 1 --shallow-submodules \
5662
--recursive https://github.com/espressif/esp-idf.git \
@@ -63,6 +69,7 @@ RUN mkdir -p ${HOME}/.espressif/frameworks/ \
6369
&& rm -rf .espressif/frameworks/esp-idf/tools/esp_app_trace \
6470
&& rm -rf .espressif/frameworks/esp-idf/tools/test_idf_size
6571

72+
# Activate ESP environment
6673
ENV IDF_TOOLS_PATH=${HOME}/.espressif
6774
RUN echo "source ${HOME}/.espressif/frameworks/esp-idf/export.sh > /dev/null 2>&1" >> ~/.bashrc
6875

0 commit comments

Comments
 (0)