2025-11-24 4:54 AM
Hello,
My usual workflow is to fire devcontainers with everything I need in order to have the right tools in every development computer used by the team.
What I notice with the vscode for stm32 is that now it is harded to pack the tools prior to using the containers.
Configuring the installed extension is not enough because then when the container runs, every st extension downloads a lot of data from the network.
Working with a lot of containers and in a huge team does not scale well because everytime a devcontaner is opened more that 2GB of data are downloaded and unpacked.
This is a waste of network, disk, time resource that could be better used.
There is a way for having the tools packed in a devcontainer? They are the future of reproducible builds and sharing configuration between programmers.
thank you in advance
Andrea
2025-11-25 12:09 AM
Thank you for sharing your workflow and challenges with STM32CubeIDE for VSCode in devcontainers. Your concerns about network bandwidth, disk usage, and time efficiency when repeatedly downloading large extension toolsets are very valid, especially in large teams using containerized development environments.
If I can please ask a question on how much devcontainers with the extension installed in you are using in your team.
The best way to avoid repeated downloads is to build a custom devcontainer image that already contains all required STM32 tools and extensions preinstalled. This approach ensures:
Create a Dockerfile extending your base image (e.g., mcr.microsoft.com/vscode/devcontainers/base).
In this Dockerfile, install STM32 tools such as:
Use VSCode’s devcontainer.json to point to this custom image.
VSCode extensions for STM32 (like ST’s official extensions) often download additional data on first launch. To avoid this:
code --install-extension /path/to/extension.vsix
This prevents network downloads on container startup.
If some tools or SDKs must be downloaded (e.g., STM32Cube MCU packages):
This avoids repeated downloads and saves bandwidth.
FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu
# Install ARM GCC toolchain
RUN apt-get update && apt-get install -y gcc-arm-none-eabi
# Copy STM32Cube packages and tools into image (assumes local folder 'stm32-tools')
COPY stm32-tools /opt/stm32-tools
# Install VSCode extensions offline
COPY extensions/*.vsix /tmp/
RUN for ext in /tmp/*.vsix; do code --install-extension "$ext"; done
# Set environment variables or PATH if needed
ENV PATH="/opt/stm32-tools/bin:${PATH}"
| Approach | Benefit | Notes |
|---|---|---|
| Prebuild custom devcontainer | No runtime downloads, fast startup | Requires Docker image build and maintenance |
| Offline VSIX extension install | Avoid extension network downloads | Need to maintain VSIX files |
| Cache SDKs/tools outside container | Save bandwidth and disk space | Use shared volumes or image copy |
2025-11-25 3:05 AM
Thank you for the time that you took for providing this reply.
Sadly in the past one would receive an RTFM reply or a letmegooglethat link. Now a copy and paste from an AI tool.
2025-11-25 3:11 AM
Why not keep the download repo on a network drive available for all?
(NI = no intelligence, just me)
2025-11-25 3:19 AM
Anyhow...
Every firmware produced lives in it's own project. Every project has its own devcontainer.
Every time a maintenance is performed on a firmware, then the devcontainer is downloaded from our devcontainer private repo and used.
@mfgkw I partially understand what you are saying. devcontainers are configured for every project in a .devcontainer folder inside vscode.
When you create the devcontainer you can add tools and libraries, then you can add vscode extensions.
Then, when the extensions load they could fetch additional software if required.
The AI reply was correct in its own sense, it is basically what you have to do in order to adapt what it is provided to the use case. Those are in any case all acks around something that is in my opinion bad design from the beginning. The extension downloads from the net 2GB of data. That's really a lot.