LoginSignup
0
0

More than 3 years have passed since last update.

ECSでdocker volumeマウントのownerを指定する

Posted at

ECSでdocker volumeをマウントするとownerはrootになります。
指定したい場合は、タスク定義のボリューム定義で、dockerVolumeConfiguration.driverOpts を指定しましょう。
例えば、tmpfsとしてボリュームを作成してownerをuid=1000, gid=1000にしたいときは、

  "volumes": [
    {
      "name": "sharedtmp",
      "dockerVolumeConfiguration": {
        "autoprovision": true,
        "scope": "shared",
        "driverOpts": {
          "type": "tmpfs",
          "device": "tmpfs",
          "o": "uid=1000,gid=1000"
        }
      }
    }
  ]

こうすることで ボリューム作成の際に以下のようにオプションをつけて作成してくれます。

$ docker volume create --opt type=tmpfs --opt device=tmpfs --opt o=uid=1000,gid=1000 sharedtmp

ElasticBeanstalkからECSを使う場合も、Dockerrun.aws.jsonに同じように書くだけです。
以上です。

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