Open6

Visual Studio Code Dev Containersなんもわからんところからメモ

terurouterurou

VS Code Remote Server は WSLとDev Containersでは自動インストールされるっぽいので、意識しないでいいっぽい

terurouterurou

.devcontainer ディレクトリ配下に Dockerfiledevcontainer.json を作れば、とりあえず最低限の構成になるらしい。

Copilotに生成してもらったdevcontainer.jsonのサンプル。

{
    "name": "My Dev Container",
    "build": {
        "dockerfile": "Dockerfile"
    },
    "features": {},
    "customizations": {},
    "postCreateCommand": "echo 'Dev Container ready!'"
}
terurouterurou

コンテナ側に自動でVS Code拡張をインストールさせるには、devcontainer.json に以下のように書けばよさそう。

    "customizations": {
        "vscode": {
            "extensions": [
                "nadako.vshaxe"
            ]
        }
    },