{"action":"created","issue":{"url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/226","labels_url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/226/comments","events_url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/226/events","html_url":"https://github.com/aws/amazon-ecs-agent/issues/226","id":111942429,"number":226,"title":"Cannot get volumesFrom to work","user":{"login":"yoanisgil","id":918271,"avatar_url":"https://avatars.githubusercontent.com/u/918271?v=3","gravatar_id":"","url":"https://api.github.com/users/yoanisgil","html_url":"https://github.com/yoanisgil","followers_url":"https://api.github.com/users/yoanisgil/followers","following_url":"https://api.github.com/users/yoanisgil/following{/other_user}","gists_url":"https://api.github.com/users/yoanisgil/gists{/gist_id}","starred_url":"https://api.github.com/users/yoanisgil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoanisgil/subscriptions","organizations_url":"https://api.github.com/users/yoanisgil/orgs","repos_url":"https://api.github.com/users/yoanisgil/repos","events_url":"https://api.github.com/users/yoanisgil/events{/privacy}","received_events_url":"https://api.github.com/users/yoanisgil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-17T03:55:22Z","updated_at":"2015-10-19T19:11:39Z","closed_at":null,"body":"I've a Dockerrun.aws.json file whic looks like this:\r\n\r\n```json\r\n{\r\n  \"AWSEBDockerrunVersion\": 2,\r\n  \"volumes\": [\r\n    {\r\n        \"name\": \"postgresql_data\",\r\n        \"host\": {}\r\n    }\r\n  ],\r\n  \"containerDefinitions\": [\r\n    {\r\n      \"name\": \"postgresql\",\r\n      \"image\": \"mdillon/postgis:9.3\",\r\n      \"essential\": true,\r\n      \"memory\": 396,\r\n      \"mountPoints\": [],\r\n      \"volumesFrom\": [\r\n        {\r\n            \"sourceContainer\": \"postgresql-data\"\r\n        }\r\n      ]\r\n    },\r\n    {\r\n      \"name\": \"coride-service\",\r\n      \"image\": \"rideeze/coride-service\",\r\n      \"essential\": true,\r\n      \"memory\": 496,\r\n      \"portMappings\": [\r\n        {\r\n          \"hostPort\": 80,\r\n          \"containerPort\": 80\r\n        }\r\n      ],\r\n      \"links\": [\r\n        \"postgresql\"\r\n      ],\r\n      \"mountPoints\": []\r\n    },\r\n    {\r\n        \"name\": \"postgresql-data\",\r\n        \"image\": \"rideeze/coride-psql-data\",\r\n        \"essential\": false,\r\n        \"memory\": 16,\r\n        \"mountPoints\": [\r\n            {\r\n                \"sourceVolume\": \"postgresql_data\",\r\n                \"containerPath\": \"/var/lib/postgresql/data\"\r\n            }\r\n        ],\r\n        \"command\": [\"tail -f /dev/null\"]\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nbut I cannot get the postgresql-data container to stay running so volumes it's volumes can be used by the postgresql volume. I would appreciate any advice.\r\n\r\nBests,\r\n\r\nYoanis.\r\n"},"comment":{"url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/comments/149316269","html_url":"https://github.com/aws/amazon-ecs-agent/issues/226#issuecomment-149316269","issue_url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/226","id":149316269,"user":{"login":"euank","id":2147649,"avatar_url":"https://avatars.githubusercontent.com/u/2147649?v=3","gravatar_id":"","url":"https://api.github.com/users/euank","html_url":"https://github.com/euank","followers_url":"https://api.github.com/users/euank/followers","following_url":"https://api.github.com/users/euank/following{/other_user}","gists_url":"https://api.github.com/users/euank/gists{/gist_id}","starred_url":"https://api.github.com/users/euank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/euank/subscriptions","organizations_url":"https://api.github.com/users/euank/orgs","repos_url":"https://api.github.com/users/euank/repos","events_url":"https://api.github.com/users/euank/events{/privacy}","received_events_url":"https://api.github.com/users/euank/received_events","type":"User","site_admin":false},"created_at":"2015-10-19T19:11:39Z","updated_at":"2015-10-19T19:11:39Z","body":"Because the data container is marked as `essential: false`, it shouldn't matter that it does not stay running. Volumes can be used when a container is created, but not running, just fine. In fact, the above task definition appeared to work for me (I verified it stayed up for a minute and `curl $host:80` gave me some json output).\r\n\r\nThe reason the `postgresql-data` container isn't running is because the command should be `[\"tail\", \"-f\", \"/dev/null\"]`, but again, that shouldn't really matter.\r\n\r\nA couple other things to note:\r\n* You probably don't need the data container at all. If you move the `mountPoints` block from it in place of the `volumesFrom` directive, things will be basically the same.\r\n* You're using an \"empty volume\" which only persists for the lifetime of this task. If you would like your data to persist between instantiations of this task or between multiple tasks, you'll want to specify a path on the host or use some other mechanism. If the \"empty volume\" isn't mounted by multiple containers in the task, it's effectively the same as not having any volume mounts at all typically. The empty volume is meant for sharing data within a single task, not between tasks.\r\n\r\nIf the above doesn't help, a bit more information would be useful:\r\n* What error are you seeing if you run `describe-tasks` on a failed instance of it?\r\n* Can you post the Agent logs around the time it fails?\r\n\r\nBest,\r\nEuan"}}