Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Base image
ARG VARIANT=bookworm-slim
FROM debian:${VARIANT}
ENV DEBIAN_FRONTEND=noninteractive
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

# Arguments
ARG CONTAINER_USER=esp
ARG CONTAINER_GROUP=esp

# Install dependencies
RUN apt-get update \
&& apt-get install -y git curl build-essential \
libudev-dev librust-libudev-sys-dev pkg-config

# Set users
RUN adduser --disabled-password --gecos "" ${CONTAINER_USER}
USER ${CONTAINER_USER}
WORKDIR /home/${CONTAINER_USER}

# Install rustup
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
--default-toolchain none -y --profile minimal

# Update envs
ENV PATH=${PATH}:/home/${CONTAINER_USER}/.cargo/bin

# Set default toolchain
RUN rustup default stable
RUN rustup component add rustfmt

EXPOSE 8000

CMD [ "/bin/bash" ]
30 changes: 30 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
"name": "esp_web_flash_server",
"build": {
"dockerfile": "Dockerfile",
"args": {
"CONTAINER_USER": "esp",
"CONTAINER_GROUP": "esp",
"ESP_BOARD": "esp32s3"
}
},
"forwardPorts": [
8000
],
"workspaceMount": "source=${localWorkspaceFolder},target=/home/esp/esp_web_flash_server,type=bind,consistency=cached",
"workspaceFolder": "/home/esp/esp_web_flash_server",
"mounts": [
"source=${localEnv:HOME}/.ssh,target=/home/esp/.ssh,type=bind,consistency=cached"
],
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"fill-labs.dependi"
]
}
}
}