Using with VS Code - stasdelen/ros-docker-env GitHub Wiki
Using with VS Code
This project supports VS Code Dev Containers to provide a fully integrated ROS development environment inside a Docker container. This setup ensures your development tools, extensions, and terminal all operate directly within the containerized workspace, making it easier to manage dependencies and avoid host conflicts.
Make sure you have Dev Containers extension.
How to Launch the Dev Container
- Open the repository folder in VS Code.
- From the Command Palette (
Ctrl+Shift+P
), run:> Dev Containers: Open Folder in Container
- VS Code will:
- Build the Docker image (if not already built).
- Spin up the
ros-dev
service as defined indocker/docker-compose.yml
. - Mount your workspace into the container.
- Open the environment using the
rosuser
account.
✅ My suggestion is to build the image with VS Code and start the container using > Dev Containers: Rebuild and Reopen in Container
. Then, you can attach a terminal session to an already started container using make attach
from docker/Makefile.
🚨🚨⚠️ Compatibility Warning (VS Code ≥ 1.99) ⚠️🚨🚨 Starting with VS Code version 1.99, support for Linux distributions using glibc versions older than 2.28 has been dropped.
Since this ROS Melodic environment is based on Ubuntu 18.04, which ships with glibc 2.27, Dev Container support will no longer work with newer versions of VS Code.
See the official FAQ for more details.
🛠️ Workarounds
- ✅ Use VS Code 1.98 or earlier for Dev Container compatibility with ROS Melodic.
- ✅ Upgrade the code base to a newer ROS version (e.g., Noetic, even ROS2).
- ✅ Use Neovim.