Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Apply dev container metadata when attaching #7887

Closed
2 tasks done
chrmarti opened this issue Jan 23, 2023 · 2 comments
Closed
2 tasks done

Test: Apply dev container metadata when attaching #7887

chrmarti opened this issue Jan 23, 2023 · 2 comments
Labels
containers Issue in vscode-remote containers testplan-item
Milestone

Comments

@chrmarti
Copy link
Contributor

chrmarti commented Jan 23, 2023

Refs: #7872

Complexity: 3

Create Issue


  • Manually start a container including metadata, e.g.: docker run -d mcr.microsoft.com/devcontainers/rust:latest sleep inf.
  • Run the Dev Containers: Attach to Existing Container command and pick the new container.
  • Check the user in the Integrated Terminal, the machine settings and the remote extensions match those in the metadata, e.g. from: https://github.com/devcontainers/images/blob/main/src/rust/.devcontainer/devcontainer.json (note that features can add their own metadata).

You can also inspect the container's devcontainer.metadata label to see the metadata: docker inspect -f '{{ index .Config.Labels "devcontainer.metadata" }}' <container id>.

@chrmarti chrmarti added containers Issue in vscode-remote containers testplan-item labels Jan 23, 2023
@chrmarti chrmarti added this to the January 2023 milestone Jan 23, 2023
@ghost ghost assigned kieferrm and dbaeumer Jan 24, 2023
@dbaeumer dbaeumer removed their assignment Jan 24, 2023
@kieferrm
Copy link
Member

Question for @chrmarti : When I inspect the containers meta data and format it, I see the customization section twice. One seems to be local to the rust feature and the other global. Why is that?

[
    {
        "id": "ghcr.io/devcontainers/features/common-utils:2"
    },
    {
        "id": "ghcr.io/devcontainers/features/git:1"
    },
    {
        "id": "ghcr.io/devcontainers/features/rust:1",
        "capAdd": [
            "SYS_PTRACE"
        ],
        "securityOpt": [
            "seccomp=unconfined"
        ],
        "customizations": {
            "vscode": {
                "extensions": [
                    "vadimcn.vscode-lldb",
                    "mutantdino.resourcemonitor",
                    "rust-lang.rust-analyzer",
                    "tamasfe.even-better-toml",
                    "serayuzgur.crates"
                ],
                "settings": {
                    "lldb.executable": "/usr/bin/lldb",
                    "files.watcherExclude": {
                        "**/target/**": true
                    },
                    "rust-analyzer.checkOnSave.command": "clippy"
                }
            }
        }
    },
    {
        "customizations": {
            "vscode": {
                "settings": {
                    "lldb.executable": "/usr/bin/lldb",
                    "files.watcherExclude": {
                        "**/target/**": true
                    },
                    "rust-analyzer.checkOnSave.command": "clippy"
                },
                "extensions": [
                    "vadimcn.vscode-lldb",
                    "mutantdino.resourcemonitor",
                    "rust-lang.rust-analyzer",
                    "tamasfe.even-better-toml",
                    "serayuzgur.crates"
                ]
            }
        },
        "remoteUser": "vscode"
    }
]

@chrmarti
Copy link
Contributor Author

Question for @chrmarti : When I inspect the containers meta data and format it, I see the customization section twice. One seems to be local to the rust feature and the other global. Why is that?

One is from the Rust feature and one is from the devcontainer.json. We could omit those in the devcontainer.json that are equal to those in the feature. Following up in devcontainers/images#372.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers testplan-item
Projects
None yet
Development

No branches or pull requests

3 participants