LoginSignup
1
1

More than 3 years have passed since last update.

vscodeでnode.js開発始める環境作り-Remode-Container

Last updated at Posted at 2021-04-28

Remote-Containerって便利

Lambda作るときにサクッとローカル環境つくりたかった。そしてローカル汚したくないのでDocker使おうと思いました。

1.ファイルコピー

予め作っておいた.devcontainerを作業ディレクトリを作ったらコピーする

$ tree .devcontainer
.devcontainer
├── Dockerfile
└── devcontainer.json

内容は今のところシンプル。好きに育てればよいです。

Dockerfile
FROM node:14

RUN set -x

.devcontainer.json
{
    "name": "Existing Dockerfile",
    "context": "..",
    "dockerFile": "./Dockerfile",
    "settings": { 
        "terminal.integrated.shell.linux": null
    },
    "extensions": [
        "oderwat.indent-rainbow",
        "ionutvmi.path-autocomplete",
        "chrmarti.regex",
        "wayou.vscode-icons-mac",
        "alefragnani.bookmarks",
        "humao.rest-client"
    ]
}

vscode操作

[><]からReopen in Container 選んで実行

image.png

image.png

完成

あとは、npm init 使えるようになってるので、どんどん作っていけばいいです。
ローカルでバージョン管理とかやめれるのが良いのかなーと思っています。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1