Skip to content

Allow Open Named Configuration File... prior to attaching #4013

Open

Description

One more suggestion to make my life easier is allowing access to command Remote-Containers: Open Named Configuration File... in command palette prior to attaching to container, or just providing a similar command that allows me to create an attach config before attaching to container.

Originally posted by Laércio de Sousa (@lbssousa) in #3345 (comment)

Activity

  1. added
    containers
    feature-request
    on Nov 13, 2020
  2. thomas-j-moffett commented on Mar 1, 2021

    @thomas-j-moffett

    I'm not sure if this is part of the original request, but it would be ideal to have the Attached Container config files specified in a repository that can be easily shared with a team. https://code.visualstudio.com/docs/remote/attach-container#_attached-container-configuration-files

    In my scenario, I am using Lando for my local dev, and I'm not looking to switch any time soon. However, I would like to take advantage of things like smart PHP intellisense, which only seems possible while running in a container (or having PHP installed on local machine, which I prefer not to do). Since I already have containers running in Lando with one of them running PHP, I would like to attach to that container, but I want the settings for that attached container to come from my project repository.

    Also, it's unclear how often the settings get updated when you attach to a running container. I was just trying some stuff out, and I deleted the settings in /root/.vscode-server/data/Machine/settings.json on the attached container to see if settings would get loaded again. I closed remote connection, and then I attached to the same running container. The settings did not get re-imported.

    I have my container settings in a directory like this on my actual local machine: ~/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/nameConfigs/NAME_OF_CONTAINER.json.

    My goal would be able to store those settings in my project repo so I can easily share with the team and have them loaded from there when attaching to the running container.

    I guess I can do some manual set up in Lando to get settings files where I need them on those containers, but since VSCode already has the core pieces of this feature, it'd best handled there.

    Also, if any of this stuff is already possible and I just missed some documentation, please let me know! I just started trying out the remote containers feature earlier today and looking at the docs.

  3. thomas-j-moffett commented on Mar 1, 2021

    @thomas-j-moffett

    I did just re-read this part from here

    Once saved, whenever you open a container for the first time with the same image / container name, these properties will be used to configure the environment.

    I think that answers my question on how often the settings get updated, but it's still unclear how I get to the state where it will re-import those settings. It doesn't seem to happen by closing connection and attaching again. Would I have to destroy the Lando app, and rebuild just to get those settings re-imported?

    Any clarification on that would be much appreciated.

  4. chrmarti commented on Mar 2, 2021

    @chrmarti
    ContributorAuthor

    thomas-j-moffett You can delete data/Machine/.writeMachineSettingsMarker to make it write the settings while attaching again.

    Could you open a new feature request for the repository with configs request?

  5. thomas-j-moffett commented on Mar 2, 2021

    @thomas-j-moffett

    Christof Marti (@chrmarti) Thanks for the note on forcing it to rewrite the settings!

    I opened #4584 as a feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

containersfeature-request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions