skip to Main Content

I ran docker container prune, but after attaching it to my new container, I still see the old container in the explorer pane in VSCode. And I do not see the new container in the explorer pane.

And if I try to open a new terminal (Terminal > New Terminal), I see:

The terminal process failed to launch: Starting directory (cwd)
"/path/inside/my/old/container" does not exist.

Whenever I create a new container based on the same image (drupal:latest), VSCode tries to open the old container based on this image, even if I give the new container a different name.

VSCode also sometimes shows the error "Workspace does not exist" when I attach it to the new container.

2

Answers


  1. Chosen as BEST ANSWER

    After attaching to the new container, I needed to do...

    File > Open Folder
    

    And then, in the Open Folder UI, I needed to edit the old path there, which still referred to the old container, and then click OK.

    For example, in the new container, the path /opt exists, so entered that path and clicked OK. This causes the explorer to refresh and the old container disappears and now I can access the new container. I can also open the terminal now.


  2. 0

    I succeeded in connecting to a remote server configured with Docker through vscode. By the way, the list of containers from the past was fetched from the remote explorer of vscode. If you look at this list of containers, they are obviously containers made with images I downloaded a few days ago. I don’t know why this is happening.

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