{"action":"opened","issue":{"url":"https://api.github.com/repos/docker/docker/issues/9878","labels_url":"https://api.github.com/repos/docker/docker/issues/9878/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/9878/comments","events_url":"https://api.github.com/repos/docker/docker/issues/9878/events","html_url":"https://github.com/docker/docker/issues/9878","id":53274681,"number":9878,"title":"Proposal: Add \"lock\" or \"no delete\" flag to container","user":{"login":"ibuildthecloud","id":1754002,"avatar_url":"https://avatars.githubusercontent.com/u/1754002?v=3","gravatar_id":"","url":"https://api.github.com/users/ibuildthecloud","html_url":"https://github.com/ibuildthecloud","followers_url":"https://api.github.com/users/ibuildthecloud/followers","following_url":"https://api.github.com/users/ibuildthecloud/following{/other_user}","gists_url":"https://api.github.com/users/ibuildthecloud/gists{/gist_id}","starred_url":"https://api.github.com/users/ibuildthecloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibuildthecloud/subscriptions","organizations_url":"https://api.github.com/users/ibuildthecloud/orgs","repos_url":"https://api.github.com/users/ibuildthecloud/repos","events_url":"https://api.github.com/users/ibuildthecloud/events{/privacy}","received_events_url":"https://api.github.com/users/ibuildthecloud/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-02T20:10:02Z","updated_at":"2015-01-02T20:10:02Z","closed_at":null,"body":"Sometimes you have really important containers, like data only containers, that you don't want accidentally deleted.  `docker rm -f $(docker ps -qa)` is just too easy to type sometimes and then, \"oh !@#!\", it's all gone.  (Well not really because you can find your data in `/var/lib/docker/vfs`).  Anyhow, I propose we add the following:\r\n\r\n`docker run/create --lock=true ...`\r\n`docker lock CID`\r\n`docker unlock CID`\r\n\r\nIf one was to do `docker rm CID` and CID was locked it wouldn't delete and exit with an error code.  Start/stop/restart should still work.  This flag is the equivalent of EC2's `DisableApiTermination` flag.  In order to delete a locked container you must first run `docker unlock CID`."}}