{"action":"closed","issue":{"url":"https://api.github.com/repos/docker-library/tomcat/issues/57","repository_url":"https://api.github.com/repos/docker-library/tomcat","labels_url":"https://api.github.com/repos/docker-library/tomcat/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/docker-library/tomcat/issues/57/comments","events_url":"https://api.github.com/repos/docker-library/tomcat/issues/57/events","html_url":"https://github.com/docker-library/tomcat/issues/57","id":194766383,"number":57,"title":"Can't use docker stop with tomcat image. Exit code 143 is returned. Exit code 0 was expected","user":{"login":"cpauls","id":24491208,"avatar_url":"https://avatars2.githubusercontent.com/u/24491208?v=4","gravatar_id":"","url":"https://api.github.com/users/cpauls","html_url":"https://github.com/cpauls","followers_url":"https://api.github.com/users/cpauls/followers","following_url":"https://api.github.com/users/cpauls/following{/other_user}","gists_url":"https://api.github.com/users/cpauls/gists{/gist_id}","starred_url":"https://api.github.com/users/cpauls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpauls/subscriptions","organizations_url":"https://api.github.com/users/cpauls/orgs","repos_url":"https://api.github.com/users/cpauls/repos","events_url":"https://api.github.com/users/cpauls/events{/privacy}","received_events_url":"https://api.github.com/users/cpauls/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-10T13:06:07Z","updated_at":"2018-04-24T21:00:12Z","closed_at":"2018-04-24T21:00:12Z","author_association":"NONE","body":"Hi,\r\nI played around with the docker container using the docker commands docker start/stop/pause... I'd like to use the [docker restart policy](https://docs.docker.com/engine/reference/run/#restart-policies-restart) with the option `on-failure:`\r\n\r\n> on-failure[:max-retries] Restart only if the container exits with a non-zero exit status. Optionally, limit the number of restart retries the Docker daemon attempts.\r\n\r\nThe tomcat docker container does not stops in the expected way. I expected exit code 0 - but the container stops with exit code 143.\r\n\r\n```\r\nvagrant@development:~$ docker --version\r\nDocker version 1.12.3, build 6b644ec\r\nvagrant@development:~$ docker run -d --name mytomcat tomcat:8.5.8\r\n00eca311039ba413b1dcfb59b0e64551e5460a4af4777057bf1476bc46e84864\r\nvagrant@development:~$ docker stop mytomcat\r\nmytomcat\r\nvagrant@development:~$ docker ps -a\r\nCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                       PORTS               NAMES\r\n00eca311039b        tomcat:8.5.8        \"catalina.sh run\"   9 seconds ago       Exited (143) 2 seconds ago                       mytomcat\r\n```\r\n\r\n**Possible solution:**\r\n- do not execute catalina.sh run. Use a wrapper script instead which execute catalina.sh start. \r\n- The wrapper script could handle the unix signals using `trap` as described in [trapping-signals-in-docker-containers](https://medium.com/@gchudnov/trapping-signals-in-docker-containers-7a57fdda7d86#.1685pl56m) or in [gracefully-stopping-docker-containers/](https://www.ctl.io/developers/blog/post/gracefully-stopping-docker-containers/)\r\n\r\nWhat do you think about this? Could this be a working solution?\r\n\r\nRegards\r\n@cpauls\r\n"}}
{"actor":{"display_login":"tianon"}}