{"action":"created","issue":{"url":"https://api.github.com/repos/dokku/dokku/issues/1734","repository_url":"https://api.github.com/repos/dokku/dokku","labels_url":"https://api.github.com/repos/dokku/dokku/issues/1734/labels{/name}","comments_url":"https://api.github.com/repos/dokku/dokku/issues/1734/comments","events_url":"https://api.github.com/repos/dokku/dokku/issues/1734/events","html_url":"https://github.com/dokku/dokku/issues/1734","id":119793262,"number":1734,"title":"Revisit docker restart policy","user":{"login":"beverku","id":5684118,"avatar_url":"https://avatars.githubusercontent.com/u/5684118?v=3","gravatar_id":"","url":"https://api.github.com/users/beverku","html_url":"https://github.com/beverku","followers_url":"https://api.github.com/users/beverku/followers","following_url":"https://api.github.com/users/beverku/following{/other_user}","gists_url":"https://api.github.com/users/beverku/gists{/gist_id}","starred_url":"https://api.github.com/users/beverku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beverku/subscriptions","organizations_url":"https://api.github.com/users/beverku/orgs","repos_url":"https://api.github.com/users/beverku/repos","events_url":"https://api.github.com/users/beverku/events{/privacy}","received_events_url":"https://api.github.com/users/beverku/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dokku/dokku/labels/type:%20rfc","name":"type: rfc","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/dokku/dokku/milestones/13","html_url":"https://github.com/dokku/dokku/milestones/v0.6.0","labels_url":"https://api.github.com/repos/dokku/dokku/milestones/13/labels","id":1673393,"number":13,"title":"v0.6.0","description":"","creator":{"login":"josegonzalez","id":65675,"avatar_url":"https://avatars.githubusercontent.com/u/65675?v=3","gravatar_id":"","url":"https://api.github.com/users/josegonzalez","html_url":"https://github.com/josegonzalez","followers_url":"https://api.github.com/users/josegonzalez/followers","following_url":"https://api.github.com/users/josegonzalez/following{/other_user}","gists_url":"https://api.github.com/users/josegonzalez/gists{/gist_id}","starred_url":"https://api.github.com/users/josegonzalez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josegonzalez/subscriptions","organizations_url":"https://api.github.com/users/josegonzalez/orgs","repos_url":"https://api.github.com/users/josegonzalez/repos","events_url":"https://api.github.com/users/josegonzalez/events{/privacy}","received_events_url":"https://api.github.com/users/josegonzalez/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":3,"state":"open","created_at":"2016-03-30T06:45:00Z","updated_at":"2016-03-30T23:48:20Z","due_on":null,"closed_at":null},"comments":39,"created_at":"2015-12-01T19:49:24Z","updated_at":"2016-03-31T22:54:27Z","closed_at":null,"body":"Is it time to look into the restart policy again with docker 1.9.x out? Add a new unless-stopped restart policy (#15348) was added in 1.9.0\r\n\r\nSee: \r\n#1591\r\n#1505  \r\n\r\n\r\n\r\nRepasting my message from https://github.com/progrium/dokku/pull/1591#issuecomment-161059631 below:\r\n\r\n\r\nOK, I was able to test out the ```docker-option --restart=unless-stopped```.  Based on the testing that I have performed this behaves as I would desire.  \r\n\r\nBelow is a summary of my testing:\r\nI have a test-app deployed with DOKKU_SCALE=2\r\n\r\n```\r\n    dokku docker-options:add test-app deploy --restart=unless-stopped\r\n    sudo reboot\r\n```\r\n\r\nAfter setting the restart option following any reboot I would see the following behavior:\r\n* The initial ```docker ps``` shows 4 containers up.\r\n* After a couple of minutes it shows only the 2 expected containers up.\r\n\r\n```docker inspect``` showed for both containers:\r\n```json\r\n\"RestartPolicy\": {\r\n            \"Name\": \"unless-stopped\",\r\n            \"MaximumRetryCount\": 0\r\n        }\r\n```\r\n\r\n\r\nAfter causing the app to crash (process.exit(1)) each container twice:\r\n```docker inspect``` showed for both containers:\r\n```json \r\n\"RestartCount\": 2\r\n```\r\n\r\n\r\nThen ```sudo reboot```\r\n* See reboot behavior description above.\r\n\r\n\r\nExecute ```dokku ps:restart test-app``` 3 Times in quick succession:\r\n* ```docker ps``` Shows 8 containers up for 1-2 minutes\r\n* Then back down to expected 2\r\n\r\n\r\nThen ```sudo reboot```\r\n* See reboot behavior description above.\r\n\r\n\r\nThen ```dokku ps:stop test-app```\r\n* ```docker ps``` shows no containers running\r\n\r\nThen ```sudo reboot```\r\n* This time only two containers come up.  \r\n* This is the same as doing a ```ps:stop``` and reboot with an app that does not have the restart policy.\r\n\r\n\r\n\r\nPush new version of the test-app\r\n* Behaves the same as the reboot behavior description above.\r\n* ```docker inspect``` shows that the RestartPolicy is retained for both containers.\r\n\r\n\r\nTest crash the test-app \r\n* the containers are still restarted\r\n\r\n\r\nThen ```sudo reboot```\r\n* Same reboot behavior described above\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dokku/dokku/issues/comments/204163229","html_url":"https://github.com/dokku/dokku/issues/1734#issuecomment-204163229","issue_url":"https://api.github.com/repos/dokku/dokku/issues/1734","id":204163229,"user":{"login":"josegonzalez","id":65675,"avatar_url":"https://avatars.githubusercontent.com/u/65675?v=3","gravatar_id":"","url":"https://api.github.com/users/josegonzalez","html_url":"https://github.com/josegonzalez","followers_url":"https://api.github.com/users/josegonzalez/followers","following_url":"https://api.github.com/users/josegonzalez/following{/other_user}","gists_url":"https://api.github.com/users/josegonzalez/gists{/gist_id}","starred_url":"https://api.github.com/users/josegonzalez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josegonzalez/subscriptions","organizations_url":"https://api.github.com/users/josegonzalez/orgs","repos_url":"https://api.github.com/users/josegonzalez/repos","events_url":"https://api.github.com/users/josegonzalez/events{/privacy}","received_events_url":"https://api.github.com/users/josegonzalez/received_events","type":"User","site_admin":false},"created_at":"2016-03-31T22:54:27Z","updated_at":"2016-03-31T22:54:27Z","body":"Sounds fine to me. We can make policies configurable in a future release."}}