LoginSignup
0
0

More than 3 years have passed since last update.

Docker 開発環境のパフォーマンスを上げる

Last updated at Posted at 2020-10-19

やりたいこと

Docker コンテナ環境 (特に VSCode Remote Containers) を快適に動かす

方法

DockerでVolumeをマウントするとき一部を除外する方法 を使って、ビルドファイル等(.gitignore に書くような場所)のボリュームマウントを外す。

経緯

VSCode の Remote Container を使ってコードのビルドを行うと動作が重くなったり、突如 Docker ホストが落ち たり、というということが発生して、最初は何が原因なのか検討もつかなかった。
マウントファイルの高負荷が原因と疑って実施してみたところ、解決、パフォーマンスも改善した。

Remote Containers を 使う場合は開発時にマウントさせる必要もあまりないと思うので、 cached のオプションを使うよりも効果が高そう。

サンプル

この方法を使っているサンプルリポジトリ
- https://github.com/tktcorporation/youtube_to_m3u8

参考

さいごに

Remote Conyainers すてき!

0
0
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
0
0