🥏

Docker + Alpineで軽量VSCode Serverを立てる

2025/02/24に公開

hotari/alpine-vscode-serverのコンテナを作成して開始します。

docker run hotari/alpine-vscode-server

以下のように表示されると思います。

*
* Visual Studio Code Server
*
* By using the software, you agree to
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
*
[2025-02-24 05:11:50] info Using GitHub for authentication, run `code tunnel user login --provider <provider>` option to change this.
To grant access to the server, please log into https://github.com/login/device and use code XXXX-XXXX

https://github.com/login/deviceにアクセスしてログインし、表示されているコードXXXX-XXXXを入力します。

さらに以下のように表示されると思います。

[2025-02-24 05:17:53] info Creating tunnel with the name: 0a1b2c3d4e5f

Open this link in your browser https://vscode.dev/tunnel/0a1b2c3d4e5f

https://vscode.dev/tunnel/0a1b2c3d4e5fにアクセスします。

いつ使うのか

実行環境ありのVSCodeの画面キャプチャなんかをするときに使えるのかなと思います。
環境分離で環境をきれいに保てるのが個人的にいいです。

Dev Containersを使うのはありですが、ボリュームのクリーンアップなどが面倒です。

Discussion