There is a plugin that allow you to connect to a docjer image and debug python plugin Answer from roopjm81 on reddit.com
🌐
Reddit
reddit.com › r/vscode › installing vs code in a docker container
r/vscode on Reddit: Installing VS Code in a Docker container
April 3, 2025 -

Hello,

I have been using VS Code for some years and recently started using Docker, but I am not an expert in IT infrastructure so I would like to know if it is possible to literally have VS Code and the elements required to use notebooks (Ipykernel, Python, etc) installed in a container, so that I can directly use it anywhere.

The reason for this approach is that I am working with some data hosted in an offline server, and the only way to work in there is through the packages and modules you install in a container. I can already use Jupyter notebook as it seems to be quite simple to get - just including python, its packages, and Jupyter notebook in the container.

However, I really am not a fan of Jupyter and I would love to set up a way to have VS Code run on that server. I would greatly appreciate any tips that anyone could give :)

Thanks a lot!

Best regards,

Red muffin

🌐
Reddit
reddit.com › r/vscode › running vscode in a docker container
r/vscode on Reddit: Running VScode in a docker container
March 28, 2020 -

Goal

Having multiple containers with different vscode instances.
Example: I want one container with a vscode with the necessary extensions (and dependecies) to do web development, other container to do back-end development, and other to do data-science development. This will avoid having tons of extensions in the same VScode instance, wich sometimes, causes conflicts.

As far as i know, this can be done accessing via browser pointing to a port of the container running VScode right? Can i access without the need of browser? This is because i use a lot keyshortcuts and i'm afraid they don't work if use VScode via browser. Also, is the performance a concern or will it run smoothly?

Some references

site A
site B

If you have other references other than the ones i provided, please share.

🌐
Reddit
reddit.com › r/docker › using vscode while developing in docker
r/docker on Reddit: Using VSCode while developing in docker
February 10, 2023 -

I'm using a local docker container to manage dependencies and requirements while developing a software. I'm using VSCode as my code editor. The problem is that my VSCode doesn't have access to the libraries (and headers), as they're installed inside the docker.

I've found out one can use an extension that will automatically install VSCode server on the docker, and my local VSCode will let me code using that server. The problem is that not only it requires to install the server, it also requires installing all the local extensions on the remote server (if I want to use them). That makes sense in cases of people developing on an actual remote server, but in my case, it means I'd have to have each extension installed twice on my machine, wasting space.

I've also thought about using volume mapped to my local workfolder (or something like that) to let me access the libraries (or at least headers) installed there, but I'm not sure how well would that work and how exactly should I go about doing that (I'm worried about shadowing/overwritting the default installed libraries on the docker if I map the volume there). Or alternatively, sharing the local and docker's extensions this way, but I think that could go very wrong.

Is there a good solution? What's the optimal way to handle this?

🌐
Reddit
reddit.com › r/docker › how can i setup vscode for an existing docker project?
r/docker on Reddit: How can I setup vscode for an existing docker project?
January 10, 2021 -

Hello guys. I am new to docker and I am given a complete project in FastAPI complete with docker-compose to work with. I am learning in the process. Currently, I'm just using docker-compose up , putting the .py files I want to run and test in the Dockerfile's CMD field and re-running docker-compose, which is a painstakingly repetitive process. Also I am using vscode and it keeps notifyingme that it can't find a python interpreter. So I was wondering if it was possible to use vscode inside the docker environment and run files individually without the need to put them in Dockerfile first. Is there any guide which I can follow? I am using Docker for windows btw.

Any help or guidance would be great. Thanks.

Edit: Thank you u/Pyodoo for the Silver!

Top answer
1 of 3
11
There is a plugin that allow you to connect to a docjer image and debug python plugin
2 of 3
2
I would highly recommend that you use VSCode Remote - Containers ms-vscode-remote.remote-containers . This will allow you to set up a development environment in a Docker container from which you can use all of the other services defined in your docker-compose.yml file. It allows you or anyone else working on the project to have an identical development environment in Docker. You can find a working example in my GitHub repo for a class that I teach on Test Driven Development (TDD) during my DevOps course: https://github.com/nyu-devops/lab-flask-tdd In it you will find a folder called .devcontainer that contains the files that Remote Containers uses. What you should do is, install Remote Containers first, then clone my repo and open it in VSCode, you will be asked if you want to Reopen in a Container. Say YES and it will download a postgres:alpine image, and build a development environment using python:3.8-slim and share your current folder with that environment so that any file you edit on your computer is seen in the container. No need to rebuild when making changes. Just edit your python code and run your service from the command line inside the container. In my example, you will also be linked to the postgres container automatically so that you can use it from your application. This is just one example of what is possible. All of the magic is driven by a file called devcontainer.json which sets everything up, including installing VSCode extensions in the Docker container. That means that you (and anyone who clones your repo) will have all of the extensions needed to work with the code. I have it on my todo list to create a video to show how all of this can be set up but I haven't made it yet. :( If you want help and your repo is on GitHub, send me a link and I'll fork it, set up Remote Containers for you, and make a Pull Request back to your repo. This should get you started. Otherwise just use my repo as a template for what is possible substituting lines from your docker-compose.yml file to build the correct development environment for you.
🌐
Reddit
reddit.com › r/docker › development container with visual studio code - how does it work?
r/docker on Reddit: Development container with Visual Studio code - how does it work?
July 28, 2022 -

Regarding visual studio code development container, am I right to understand that the docker container interacts with the source code you're working on by remotely accessing it? And the dependencies required to develope are stored in the docker container.

As seen here: https://docs.microsoft.com/en-us/learn/modules/use-docker-container-dev-env-vs-code/3-use-as-development-environment

Thank you

Find elsewhere
🌐
Reddit
reddit.com › r/docker › running vscode inside a container?
running vscode inside a container? : r/docker
September 19, 2025 - vscode is just one IDE I wanted to ensure works "out of the box" when run inside the container (it also happens to be the first one I tried) ... why? if you want all devs to have the same dependencies simply make them a dockerfile that packs the app in the same way for all 150 devs.
🌐
Reddit
reddit.com › r/docker › help on docker and vs code
r/docker on Reddit: Help on Docker and VS Code
July 22, 2024 -

Hi!

Where I work we're starting to use containers and Kubernetes to deploy apps.

I've been reading about it but still have some thins that I don't understand.

This is my situation:

  • working on vs code on my windows pc

  • connect to a ubuntu machine where I develop in python

  • installed docker on the ubuntu

I've created a development environment as said in https://code.visualstudio.com/docs/devcontainers/create-dev-container where I installed all the packages I needed.

I developed a small app just for testing and have no errors.

Questions:

  1. How do I deliver the app to the Kubernetes guy?

  2. Do I have to make a Dockerfile?

  3. Is it better to create a container through the json file or with a Dockerfile?

  4. I have some setup variables to change user/pass/servers and some other things that can change depending of the situation. Usually I create a .env file from where I read the values. Can the Kubernetes guy replace that file when deploying the container or do I need to put that all in environment variables?

Any help or point to help would be greatly appreciated! :)

TY!

🌐
Reddit
reddit.com › r/docker › developing a vs code extension inside docker
r/docker on Reddit: Developing a VS Code Extension inside Docker
May 17, 2024 -

Hey,

I would like to dev a VS code extension inside of a Docker container. I am still unfamiliar with Docker as well a developing an extension. This is my first real side project.

I was wondering if you could enlighten me a little on how to best approach this. Originally, what I wanted to try is to do everything on the container instance and have absolutely nothing installed on my computer. Nonetheless, the more I explore, the more it seems overly complicated.

My idea was to therefore install Node.js and yo on my local machine using the following:

npm install --global yo generator-code

yo code

After the structure is created, I could then create a Docker image to start developing inside the container.

I have a few questions:

  • What do you guys think about this process, could I have done it without using the yo library ?

  • Any base image you recommend, I was trying node:14 but it wouldn't create the expected workdir usr/src/app

  • Any other tips or recommendations ?

Thank you so much in advance !

🌐
Reddit
reddit.com › r/docker › how to use vscode in a container in a remote machine?
r/docker on Reddit: How to use VScode in a container in a remote machine?
December 16, 2022 - Sorry for not giving context, I clicked twice the button by pure dumbness. ... Log into the remote machine with SSH from VScode and once done install docker remote extension on that remote box.
🌐
Visual Studio Code
code.visualstudio.com › docs › containers › overview
Containers in Visual Studio Code
November 3, 2021 - On Linux, you should also enable Docker CLI for the non-root user account that will be used to run VS Code. To install the extension, open the Extensions view (⇧⌘X (Windows, Linux Ctrl+Shift+X)), search for container tools to filter results and select the Container Tools extension authored by Microsoft.
🌐
Reddit
reddit.com › r/docker › accessing docker container in vscode
r/docker on Reddit: Accessing docker container in VSCODE
July 20, 2024 -

Hello everyone,

I have installed docker on my local machine (Ubuntu). Then created 2 docker containers, one for Odoo, the other for Postgresql.

In my vscode terminal, I added the current user to the docker group successfully. And I can run "docker compose up -d" without sudo. But I still can't access the container in vscode.

I'm using the extension: Dev Containers by Microsoft. When I try "Dev Containers: open folder in container", I get the following message in a window:

Current user does not have permission to run 'docker'. Try adding the user to the 'docker' group.

Has anyone faced this issue before? And how to solve it?

Thanks in advance...

🌐
Reddit
reddit.com › r/docker › minimal dev environment: vs code + docker
r/docker on Reddit: Minimal Dev Environment: VS Code + Docker
October 1, 2020 -

Like most developers, I like to keep my workstation clean. This is a quick rundown of how you can have a working dev setup, specifically for web apps, on Windows 10, Mac OSX and Linux. Sorry BSDs...  

Things you need  

  1. Docker

  2. VS Code

  3. An SSH client (Optional)

You probably already have the first two installed, or know how to install it. The last requirement is also available on most Linux distros and MacOS out of the box.

Linux users are required to add their regular user to the Docker user group:

$ sudo usermod -aG docker $USER 

For this change to take effect you need to log out and sign back in.

Why use Remote - Container?

Remote Container extension allows you to focus on your ideas and not the environment. Start developing directly within a container, with a fully functional editor, i.e, VS Code. Its integrated shell also allows you to use the container as a functional Linux environment. Install the extension by visiting this page.

You can start by simply pulling a Docker image of your choice, spin up a container, and use VS Code to start editing files within that container.

No need to install dozens of packages on your host system, neither will you have several dozen Docker images cluttering your workspace as you tweak and fiddle with Dockerfiles. Only when you have a working prototype of your app, should you consider creating a Dockerfile to package it.

You can even use base OS images like Alpine or Ubuntu, if you want.

Getting started

  1. With the extension installed, let us create a container named dev0using the official Node.js image from Docker Hub:

$ docker run -dit --name dev0 -p 3000:3000 node

2. Next, open VS Code, and if you have the extension installed you will see a small green icon at the bottom left corner of the screen. 3. It will show you various options, let's select "Attach to Running Container" option:

This is followed by selecting the proper container name. In our case, this is dev0.

Your New Environment

This is where a new instance of the VS Code will open up. If you now open the integrated terminal (use keyboard shortcut Ctrl+`) this will drop you in a shell inside the container.

Since we are using a Node.js container, it already has node and NPM available for us, let us start a small project:

$ mkdir app
$ npm init
## Keep hitting Return to accept the defaults and reply 'yes' when prompted
$ npm install --save express

Create a file 'index.js' in here, and try out this simple "Hello, world" snippet that uses express framework:

const express = require('express')
const app = express()
const port = 3000

app.get('/', (req, res) => res.send('Hello World!'))

app.listen(port, () => console.log(`Example app listening on port ${port}!`))

Using the integrated terminal, run the above code:

$ node index.js

The result can be seen at http://localhost:3000/ . You can now continue to work on your app and use localhost:3000 to access its contents.

If you want to open a new directory /foo/bar, run the following command inside the container, using VS Code integrated terminal:

$ code /foo/bar

This opens another instance of VS Code with /foo/bar. You can invoke VS Code from inside the container dev0!

Side Note

If you open a VS code workspace in a specific folder, say, /root/app directory, then delete the container, and create a new one to connect via VS Code, it will try to reopen /root/app directory.

Since the directory no longer exists, the remote session will be rendered unusable.

At the time of this writing, the extension of the remote container is still in preview, and hopefully, this bug will be resolved in future updates. For now, you can mitigate this issue by creating whatever directory VS Code is expecting, like, /root/app:

$ docker exec dev0 bash -c "mkdir -p /root/app"

It's not the tidiest solution, but it does circumvent the issue.

Bind Mounts

If you have a current project that you want to test inside a running container, you can do that using VS Code as well. The same extension can allow you to setup bind mounts so you can access parts of the host filesystem within the container.

For example, if you have a directory ~/Desktop/app on my host system, you can start by:

  1. Clicking on the same green icon and then selecting "Remote-Container: Open Folder in container..."

  2. Selecting that folder, and then picking a container image offered by Microsoft will allow you to open those file inside a newly created container.

  3. When prompted, give Docker the necessary permissions to access the host file system.

  4. Select one of the many container images offered by VS Code.

  5. Start hacking!

There are a few caveats, however:

  1. You have a limited set of container images offered by VS Code itself, to use with the bind mount feature.

  2. If you are on Windows, you need to tweak your VS Code to use Unix style line endings (a.k.a LF) and a compatible character encoding like UTF-8 or ASCII.

Moving Forward

If the above workflow appeals to you, there is more! The extension is still in preview and it will become more functionally stable with each commit that it gets.

Send pull requests, report issues and don't forget to have fun!

This article was originally published onhttps://appfleet.com/blog/minimal-dev-environment-vs-code-docker-3/ and has been authorized by Appfleet for a republish.

Top answer
1 of 5
5
Nice! You describe my setup very well. Those tools are really the only software I really use. Well plus browsers to test things and a few random tools like Atmel Flip to program AVR microcontrollers, or PuTTY to complete some missing Windows functionality. But the C compiler for that microcontroller and the complete toolset are run in Docker. For web projects, it's seriously ideal, the entire environment stays isolated and easy to reproduce on a server. Basically I have what you mentioned plus games on Steam. I'd like to add 1 container that I use in my dev setup: jwilder/nginx-proxy. With this thing, you can really easily invent non-existing domain names (e.g. local.myproject.com) and run them all on port 80 without having to shut down dev environments to run multiple setups.
2 of 5
4
I don't suggest an "attach to running container" workflow. It has several drawbacks. If you have an existing codebase, then just do the steps below. If you are starting fresh, then just create an empty project on github with a standard .gitignore for Node. F1. and start typing: "Remote-Containers: Clone Repository in Container Volume" When prompted, paste in the url to your repository. I use the https:// url and not the ssh version. https works better on Windows. Choose "unique volume" - this will isolate your code and provide max performance in comparison as bind mounts are slow. Pick your container base image from the list: "node.js." Wait while it builds. It will add a .devcontainer folder with a Dockerfile. From VSCode, just commit these new files and push to github. You're done. After you close VSCode, you can reopen the project from your recent files menu. Also, you don't need to mess with line endings, or anything.
🌐
Reddit
reddit.com › r/docker › is there a docker image specifically for remote vscode development?
r/docker on Reddit: Is there a docker image specifically for remote VSCode development?
June 15, 2023 -

I plan on moving my dev environment to a docker container and using VSCode with the Remote Explorer extension to work on my project remotely. Are there any docker images already created just for this? Or should I just use a node image?

Thanks

🌐
Reddit
reddit.com › r/docker › anyone here use vscode?
r/docker on Reddit: Anyone here use vscode?
October 14, 2020 -

Hi.

I recently joined a project with collaborators where we use docker. I'm the only one using vscode in the team, and this my first time working with docker (though I'm getting used to it and it's amazing).

I see lots of ways to add development container configurations with vscode, but I'm not sure how to open a container that has a pre-existing Dockerfile that someone else created in vscode. If I were to modify that Dockerfile I would need permission too.

Frankly there are too many options for ways too add configurations I'm at a loss what to do.

Any help is appreciated:)

Edit: The solution was in the documentation as it should have. It seems I was confused with what the documentation was saying and the solution slipped through my attention here. Reading the replies has helped me learn about docker tho. Thank you all for your help:)

🌐
Reddit
reddit.com › r/docker › vs code docker extensions
r/docker on Reddit: VS Code Docker extensions
May 5, 2025 -

I used to have the Docker (from Microsoft) and Docker DX (from Docker) extensions installed in VS Code, but I got a notice that they were being replaced with Container Tools and Dev Containers (both from Microsoft) going forward.

Is that correct? I have Docker and Docker DX disabled. Should I just uninstall them?

I really only use the extensions so that any errors are shown in my Dockerfile and docker-compose.yaml files.

🌐
Visual Studio Code
code.visualstudio.com › docs › devcontainers › containers
Developing inside a Container
November 3, 2021 - Add your user to the docker group by using a terminal to run: sudo usermod -aG docker $USER · Sign out and back in again so your changes take effect. Install Visual Studio Code or Visual Studio Code Insiders. Install the Dev Containers extension.
🌐
Visual Studio Code
code.visualstudio.com › docs › devcontainers › tutorial
Dev Containers tutorial
November 3, 2021 - To create a Docker container, we are going to open a GitHub repository with a Node.js project. Open the Command Palette (F1) to run the command Dev Containers: Try a Dev Container Sample... and select the Node sample from the list. Note: There are other dev container samples such as vscode-remote-try-python or vscode-remote-try-java, but this tutorial will use vscode-remote-try-node.