10

I am using Remote-Containers extension on VSCode to work directly on my running containers. The project hierarchy of my container looks like this:

angular_container
    /usr/
        src/
            app/
                frontend/
                    my-source-files

I right-click my container and select the 'Attach Visual Studio Code' option. By default, this opens the /usr/src/app/src/ directory on my container, which doesn't exist. Is there a way to change this setting so that VSCode opens the /usr/src/app/ directory instead? The Remote - Containers extension settings does not specify anything like this.

1
  • I can't believe nobody upvoted you. Thanks for asking the question! Commented Oct 7, 2022 at 13:31

1 Answer 1

24

Maybe, you selected it by default but you can change it:

Open the command list: Shift + Ctrl + P

Search for this command and select it: Remote-Containers: Open attached container configuration file

Select your container from the list, this will open your configuration.

Something like this:

{
    "workspaceFolder": "/root",
    "extensions": [
        "ms-python.python",
        "ms-toolsai.jupyter"
    ]
}

Change the workspaceFolder with your desired.

Save and re attach the container.

Sign up to request clarification or add additional context in comments.

2 Comments

On macbook, the command is Shift + Command + p and then enter Dec Containers: Open attached container configuration file
wonderful, many thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.