LoginSignup
0

More than 1 year has passed since last update.

Docker Volumeについてメモ

Posted at

背景

既存のdocker.compose.yml を変更することになった。
「内容としては、volume名をhash値から命名する」というもの。新卒になってdockerまわりの知識をつけたいと思っていたので、それのメモとして残しておく。

volumeとは

Docker コンテナにおいて生成され利用されるデータを永続的に保持する目的で作られた仕組み

外部のHDDのようなイメージだそう

volume vs バインドマウント

  • volume
    • ホストマシン上に新たなディレクトリを生成し、dockerの保存先となる
  • バインドマウント
    • ホストマシン上のファイルやディレクトリをコンテナ内にマウントする
    • 必ずホストにディレクトリが必要

参考

https://matsuand.github.io/docs.docker.jp.onthefly/storage/volumes/
https://qiita.com/gounx2/items/23b0dc8b8b95cc629f32

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