{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/17171","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/17171/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/17171/comments","events_url":"https://api.github.com/repos/docker/docker/issues/17171/events","html_url":"https://github.com/docker/docker/issues/17171","id":112127497,"number":17171,"title":"Restart policy doesn't work with docker run, but does with docker start","user":{"login":"jonnystoten","id":1392159,"avatar_url":"https://avatars.githubusercontent.com/u/1392159?v=3","gravatar_id":"","url":"https://api.github.com/users/jonnystoten","html_url":"https://github.com/jonnystoten","followers_url":"https://api.github.com/users/jonnystoten/followers","following_url":"https://api.github.com/users/jonnystoten/following{/other_user}","gists_url":"https://api.github.com/users/jonnystoten/gists{/gist_id}","starred_url":"https://api.github.com/users/jonnystoten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonnystoten/subscriptions","organizations_url":"https://api.github.com/users/jonnystoten/orgs","repos_url":"https://api.github.com/users/jonnystoten/repos","events_url":"https://api.github.com/users/jonnystoten/events{/privacy}","received_events_url":"https://api.github.com/users/jonnystoten/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-10-19T11:42:22Z","updated_at":"2016-03-18T20:30:14Z","closed_at":null,"body":"I have a container that I know will exit with a non-zero status code. If I run it with `docker run --restart always --name auth_test rocketmakers/auth:0.1.0`, it just quits, and the status is \"Exited (1)\".\r\n\r\nIf I then run `docker start auth_test`, the container restarts itself in a loop (what I expect).\r\n\r\nUse the commands below to provide key information from your environment:\r\n\r\n**docker version:**\r\n```\r\nClient:\r\n Version:      1.8.1\r\n API version:  1.20\r\n Go version:   go1.4.2\r\n Git commit:   d12ea79\r\n Built:        Thu Aug 13 02:49:29 UTC 2015\r\n OS/Arch:      darwin/amd64\r\n\r\nServer:\r\n Version:      1.8.3\r\n API version:  1.20\r\n Go version:   go1.4.2\r\n Git commit:   f4bf5c7\r\n Built:        Mon Oct 12 18:01:15 UTC 2015\r\n OS/Arch:      linux/amd64\r\n```\r\n**docker info:**\r\n```\r\nContainers: 13\r\nImages: 242\r\nStorage Driver: aufs\r\n Root Dir: /mnt/sda1/var/lib/docker/aufs\r\n Backing Filesystem: extfs\r\n Dirs: 268\r\n Dirperm1 Supported: true\r\nExecution Driver: native-0.2\r\nLogging Driver: json-file\r\nKernel Version: 4.1.10-boot2docker\r\nOperating System: Boot2Docker 1.8.3 (TCL 6.4); master : af8b089 - Mon Oct 12 18:56:54 UTC 2015\r\nCPUs: 1\r\nTotal Memory: 1.956 GiB\r\nName: default\r\nID: OLWI:IP42:RC4A:YORG:RCWB:GBCH:REOP:2J6K:P5MG:FA5M:BGS5:PVYJ\r\nDebug mode (server): true\r\nFile Descriptors: 50\r\nGoroutines: 103\r\nSystem Time: 2015-10-19T12:58:07.148374541Z\r\nEventsListeners: 2\r\nInit SHA1:\r\nInit Path: /usr/local/bin/docker\r\nDocker Root Dir: /mnt/sda1/var/lib/docker\r\nLabels:\r\n provider=virtualbox\r\n```\r\n**uname -a:**\r\n```\r\nDarwin jonny.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64\r\n```\r\n\r\n**Provide additional environment details (AWS, VirtualBox, physical, etc.):**\r\n\r\nRunning VirtualBox on OS X via docker-machine.\r\n\r\n**List the steps to reproduce the issue:**\r\n1. `docker run --restart always --name auth_test busybox sh -c 'sleep 1; exit 1'; docker events` as per @phemmer's example\r\n\r\n**Describe the results you received:**\r\nNo output from `docker events`, `docker ps -a` shows that the container status is \"Exited (1)\"\r\n\r\n**Describe the results you expected:**\r\nThe same output as @phemmer got\r\n\r\n**Provide additional info you think is important:**\r\nWhen I run\r\n```\r\n$ docker create --restart always --name auth_test busybox sh -c 'sleep 1; exit 1'\r\n$ docker start auth_test; docker events\r\n```\r\nI get the expected output.\r\n\r\n----------END REPORT ---------"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/198529515","html_url":"https://github.com/docker/docker/issues/17171#issuecomment-198529515","issue_url":"https://api.github.com/repos/docker/docker/issues/17171","id":198529515,"user":{"login":"pvnovarese","id":13053866,"avatar_url":"https://avatars.githubusercontent.com/u/13053866?v=3","gravatar_id":"","url":"https://api.github.com/users/pvnovarese","html_url":"https://github.com/pvnovarese","followers_url":"https://api.github.com/users/pvnovarese/followers","following_url":"https://api.github.com/users/pvnovarese/following{/other_user}","gists_url":"https://api.github.com/users/pvnovarese/gists{/gist_id}","starred_url":"https://api.github.com/users/pvnovarese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pvnovarese/subscriptions","organizations_url":"https://api.github.com/users/pvnovarese/orgs","repos_url":"https://api.github.com/users/pvnovarese/repos","events_url":"https://api.github.com/users/pvnovarese/events{/privacy}","received_events_url":"https://api.github.com/users/pvnovarese/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T20:30:14Z","updated_at":"2016-03-18T20:30:14Z","body":"Just ran into this on 1.11 experimental, so it's still hanging around."}}