skip to Main Content

I know it is generally possible to connect to a container’s python interpreter with:

  • remote containers
  • remote ssh

The problems I have with these solutions:

  • it opens a new window where I need to install/specify all extensions again
  • it opens a new window per container. I am working in a monorepo where each services’s folder is mounted in a different container (connected via docker compose)

Is there a solution that allows me to specify a remote container to connect to simply for the python interpreter (and not for an entirely new workspace)?

2

Answers


  1. As illustrated by this question, it is still not possible to open multiple remote (SSH/Container) inside the same VSCode workspace/window.

    If possible, try and adapt your workflow to:

    • have multiple python container running on the same remote server, each one mounting a different remote server folder, one per project
    • have one remote SSH connection to that remote server (which, again, is already running the python containers, one per project)
    • open multiple (remote) folder within your current workspace.

    That way, you are decoupling:

    • the development environment (multiple projects, with their respective python containers)
    • from the development IDE (one local VSCode instance, connected through one SSH session to the development server).
    Login or Signup to reply.
  2. it opens a new window where I need to install/specify all extensions again

    You only need to do that once. Save your workspace and when you open the workspace next time it will have your configuration as you defined it

    Can you clarify what you are trying to achieve? Is it for development or for connecting to running instances of your services to debug?

    For debugging, have you read docs on attaching to containers started with docker compose?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search