-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitpod.Dockerfile
45 lines (42 loc) · 2.09 KB
/
.gitpod.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
# Note: gitpod/workspace-base image references older version of CMake, it's necessary to install newer one
FROM gitpod/workspace-base
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
# ARGS
ARG CONTAINER_USER=gitpod
ARG CONTAINER_GROUP=gitpod
ARG TOOLCHAIN_VERSION=1.61.0.0
ARG ESP_IDF_VERSION=release/v4.4
ARG ESP_BOARD=esp32
ARG INSTALL_RUST_TOOLCHAIN=install-rust-toolchain.sh
# Install dependencies
RUN sudo install-packages git curl gcc ninja-build libudev-dev libpython2.7 \
python3 python3-pip libusb-1.0-0 libssl-dev pkg-config libtinfo5 clang
# Set User
USER ${CONTAINER_USER}
WORKDIR /home/${CONTAINER_USER}
# Install Rust toolchain, extra crates and esp-idf
ENV PATH=${PATH}:/home/${CONTAINER_USER}/.cargo/bin:/home/${CONTAINER_USER}/opt/bin
ADD --chown=${CONTAINER_USER}:${CONTAINER_GROUP} \
https://github.com/esp-rs/rust-build/releases/download/v${TOOLCHAIN_VERSION}/${INSTALL_RUST_TOOLCHAIN} \
/home/${CONTAINER_USER}/${INSTALL_RUST_TOOLCHAIN}
RUN chmod a+x ${INSTALL_RUST_TOOLCHAIN} \
&& ./${INSTALL_RUST_TOOLCHAIN} \
--extra-crates "cargo-espflash ldproxy" \
--clear-cache "YES" --export-file /home/${CONTAINER_USER}/export-esp.sh \
--esp-idf-version ${ESP_IDF_VERSION} \
--minified-esp-idf "YES" \
--build-target ${ESP_BOARD}
# Install web-flash and wokwi-server
RUN curl -L https://github.com/bjoernQ/esp-web-flash-server/releases/latest/download/web-flash-x86_64-unknown-linux-gnu.zip \
-o /home/${CONTAINER_USER}/.cargo/bin/web-flash.zip \
&& unzip /home/${CONTAINER_USER}/.cargo/bin/web-flash.zip \
-d /home/${CONTAINER_USER}/.cargo/bin/ \
&& rm /home/${CONTAINER_USER}/.cargo/bin/web-flash.zip
RUN chmod u+x /home/${CONTAINER_USER}/.cargo/bin/web-flash
RUN curl -L https://github.com/MabezDev/wokwi-server/releases/latest/download/wokwi-server-x86_64-unknown-linux-gnu.zip \
-o /home/${CONTAINER_USER}/.cargo/bin/wokwi-server.zip \
&& unzip /home/${CONTAINER_USER}/.cargo/bin/wokwi-server.zip \
-d /home/${CONTAINER_USER}/.cargo/bin/ \
&& rm /home/${CONTAINER_USER}/.cargo/bin/wokwi-server.zip
RUN chmod u+x /home/${CONTAINER_USER}/.cargo/bin/wokwi-server