LoginSignup
10
11

More than 5 years have passed since last update.

dockerのtmpfsオプション

Posted at

docker本体にオプションとして組み込まれてたの知らなかった…
コンテナ内で素直にtmpfsをmountしようとすると、権限の調整が必要でちょっと面倒。

docker runなど

https://docs.docker.com/engine/reference/commandline/run/
http://docs.docker.jp/engine/reference/commandline/run.html#tmpfs-tmpfs (日本語訳)

tmpfsオプションがある

      --tmpfs value                 Mount a tmpfs directory (default [])

docker-compose

そのまんまtmpfsという設定を書けば良い。ディレクトリ一個で良いなら文字列、複数パスにtmpfsマウントしたいなら配列で渡す。

tmpfs: /run
tmpfs:
  - /run
  - /tmp
10
11
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
10
11