Add devcontainer (#4491)

devcontainers can be used by IDEs/editors like VS Code to create a standardized development environment in a container
This commit is contained in:
John Hollowell 2024-08-23 21:25:16 -04:00 committed by Kevin Hester
parent eddb72705f
commit 17b2a83b44
3 changed files with 55 additions and 0 deletions

24
.devcontainer/Dockerfile Normal file
View File

@ -0,0 +1,24 @@
FROM mcr.microsoft.com/devcontainers/cpp:1-debian-12
# [Optional] Uncomment this section to install additional packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
ca-certificates \
g++ \
git \
libbluetooth-dev \
libgpiod-dev \
liborcania-dev \
libssl-dev \
libulfius-dev \
libyaml-cpp-dev \
pkg-config \
python3 \
python3-pip \
python3-venv \
python3-wheel \
wget \
zip \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip3 install --no-cache-dir -U platformio==6.1.15

View File

@ -0,0 +1,28 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
{
"name": "Meshtastic Firmware Dev",
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers/features/python:1": {
"installTools": true,
"version": "latest"
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"platformio.platformio-ide",
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [ 4403 ],
// Run commands to prepare the container for use
"postCreateCommand": ".devcontainer/setup.sh",
}

3
.devcontainer/setup.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env sh
git submodule update --init