Whenever I attach VSCode to a container, it starts with no specific folder opened. I want to open folder "/ado" on start and apply the workspace settings there. How can I achieve this?

When I open the folder manually, I start in the /root folder of the container.


    "name": "Portal Docker Environment",
    "dockerComposeFile": "docker-compose.yml",
    "service": "api",
    "workspaceFolder": "/ado",
    "cwd": "/ado",
    "extensions": [


  build: Dockerfiles/portal
  image: portal
  command: launch_portal.py
    - ./ado:/ado
    - "6543"
    - "51000:51000"   # for ptvsd debugger
    - ./portal.env

I also had no luck finding the complete list of possible keywords available in .devcontainer.json. Can anyone point me in the right direction?

Update: Found the keyword reference for .devcontainer.json

1 Answers

thomiel On

Got a response in the Github ticket:

"When attaching to a running container it is not known what your current workspace folder is. Therefore the user has to pick the folder."

So, attaching to a contaioner and then automatically opening a specific folder isn't possible, it seems. But I discovered that F1 Remote-Containers: Reopen Folder in Container roughly gets me where I want to go.