Skip to content

Instantly share code, notes, and snippets.

@sidwarkd
Last active February 23, 2026 22:34
Show Gist options
  • Select an option

  • Save sidwarkd/377b66dbe307abe1b85bc2774c93209b to your computer and use it in GitHub Desktop.

Select an option

Save sidwarkd/377b66dbe307abe1b85bc2774c93209b to your computer and use it in GitHub Desktop.
ESP32 Docker Dev Container Setup
{
"name": "ESP-IDF v5.5.3",
"build": {
"dockerfile": "Dockerfile",
"args": {
"USER": "ubuntu"
}
},
"customizations": {
"vscode": {
"extensions": [
"espressif.esp-idf-extension"
"ms-vscode.cpptools",
"ms-vscode.vscode-serial-monitor",
"ms-vscode.hexeditor",
"github.copilot",
"bierner.markdown-mermaid",
"esbenp.prettier-vscode"
],
"settings": {
"idf.gitPath": "/usr/bin/git",
"terminal.integrated.defaultProfile.linux": "bash",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.tabSize": 2,
"editor.insertSpaces": true,
"[markdown]": {
"editor.rulers": [120],
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 120,
"diffEditor.ignoreTrimWhitespace": false,
"editor.quickSuggestions": {
"comments": "off",
"strings": "off",
"other": "off"
}
},
"[c]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-vscode.cpptools"
},
"[cpp]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-vscode.cpptools"
},
"[h]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-vscode.cpptools"
},
"[hpp]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-vscode.cpptools"
},
"workbench.colorCustomizations": {
"editorRuler.foreground": "#868686"
}
}
}
},
"remoteUser": "ubuntu"
}
# root user to install the necessary tools and dependencies for the
# ESP-IDF development environment
ARG USER=root
# Use the official Espressif IDF Docker image as base
# ALWAYS use a tagged version (starts with 'v') to ensure build
# reproducibility. Release tags will change commits, don't use them
FROM espressif/idf:v5.5.3
# Install udev to allow the IDF extension serial monitor to work
# properly. This is also where you add any additional tools or
# dependencies you need for your development environment.
RUN apt-get update -y && apt-get install -y --no-install-recommends \
udev \
&& rm -rf /var/lib/apt/lists/*
# Switch back to the non-root user for the rest of the setup
# Important for non-root users to have access to the IDF tools
ARG USER
# Add IDF tools to bash session
# This loads IDF into every terminal session you open
RUN echo "source /opt/esp/idf/export.sh" >> /home/${USER}/.bashrc
# Required for the ESP-IDF tools to work properly
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment