Why
Consistent: Development environments across team members – everyone uses the exact same setup and you develeop your application in the same environment it will run in production.
Isolation: Dependencies and configurations don’t conflitc with other projects
Portability: Containers run reliable accross different machines and platforms
How
- Consider that you have the following Dockerfile in project root directory:
FROM ubuntu:24.04
WORKDIR /app
COPY . .
Open the project directory in VSCode
Press Ctrl+Shift+P and search for: Dev Container: Reopen in Container
In the next prompt, select From Dockerfile
In Optional Files/Directories, select .GitHub/debendabot.yml
VSCode will start the Docker Container and when finished, will open the IDE inside the container.
A directory called .devcontainer has been created. This directory has the configurations of Dev Container Extension for your project. See how customize your environment.