title: How do I use EBS volume with ECS container
body: <p>I created an EBS volume, attached and mounted it to my Container Instance. In the task definition volumes I set the volume Source Path with the mounted directory.
  The container data is not beeing created in the mounted directory, all other directories out of the mounted EBS works properly.</p>
  
  <p>The purpose is to save the data out of the container and with this another volume backup it.</p>
  
  <p>Is there a way to use this attached volume with my container? or is a better way to work with volumes and backups.</p>
  
  <p><strong>EDIT</strong>: It was tested with a random docker image running it specifying the volume and I faced the same problem. I manage to make it work restarting the Docker service but I'm still looking for a solution without restart Docker.</p>
  
  <p>Inspecting a container with a volume directory that is the mounted EBS</p>
  
  <pre><code>"HostConfig": {
    "Binds": [
    "/mnt/data:/data"
  ],
  ...
  "Mounts": [
    {
      "Source": "/mnt/data",
      "Destination": "/data",
      "Mode": "",
      "RW": true,
      "Propagation": "rprivate"
    }
  ],
  </code></pre>
  
  <p>the directory displays:</p>
  
  <pre><code>$ ls /mnt/data/
  lost+found
  </code></pre>
  
  <hr>
  
  <p>Inspecting a container with a volume directory that is not the mounted EBS</p>
  
  <pre><code>"HostConfig": {
    "Binds": [
      "/home/ec2-user/data:/data"
    ],
  ...
  "Mounts": [
    {
      "Source": "/home/ec2-user/data",
      "Destination": "/data",
      "Mode": "",
      "RW": true,
      "Propagation": "rprivate"
    }
  ]
  </code></pre>
  
  <p>the directory displays:</p>
  
  <pre><code>$ ls /home/ec2-user/data
  databases dbms
  </code></pre>