initial commit to this copied repo.

This commit is contained in:
Jens Noack (z003u7dz) 2025-02-12 10:07:58 +01:00
commit 019f8768cd
71 changed files with 6812 additions and 0 deletions

View file

@ -0,0 +1,33 @@
ARG VARIANT=bookworm
FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT}
RUN sudo apt-get update
RUN export DEBIAN_FRONTEND=noninteractive && \
sudo apt-get -y install --no-install-recommends \
clang \
python3-venv \
udev
## Set up udev rules for PlatformIO
RUN curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/system/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules
RUN service udev restart
RUN usermod -a -G dialout vscode
RUN usermod -a -G plugdev vscode
ARG FEDORA_COMPAT=0
### Set up compatibility with Fedora host (if needed)
### Since Fedora uses `18` as the group for dialout, we need to add it to the container
RUN if [ "$FEDORA_COMPAT" = "1" ]; then \
sudo groupadd -g 18 compat_dialout; \
sudo usermod -a -G compat_dialout vscode; \
fi
# Install PlatformIO CLI
USER vscode
RUN curl -fsSL -o /tmp/get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py
RUN python3 /tmp/get-platformio.py
RUN echo 'export PATH="$PATH:$HOME/.platformio/penv/bin"' | tee -a /home/vscode/.bashrc /home/vscode/.zshrc
RUN echo 'export PATH="$PATH:$HOME/.platformio/penv/bin"' | sudo tee -a /root/.bashrc /root/.zshrc

View file

@ -0,0 +1,33 @@
{
"name": "PlatformIO (Community)",
"build": {
"dockerfile": "Containerfile",
"context": ".",
"args": {
"FEDORA_COMPAT" : "1", // enables fedora compatibility mode (extra dialout group with gid 18)
"VARIANT": "bookworm"
}
},
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh"
},
"extensions": [
"ms-vscode.cpptools",
"platformio.platformio-ide"
]
}
},
"forwardPorts": [
8008
],
"mounts": [
"source=/dev/,target=/dev/,type=bind,consistency=consistent"
],
"runArgs": [
"--privileged"
],
"features": {},
"postAttachCommand": "sudo service udev restart"
}