{"action":"opened","issue":{"url":"https://api.github.com/repos/docker/docker/issues/22845","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/22845/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/22845/comments","events_url":"https://api.github.com/repos/docker/docker/issues/22845/events","html_url":"https://github.com/docker/docker/issues/22845","id":155854055,"number":22845,"title":"Multiple OCI Runtime Support","user":{"login":"mlaventure","id":16065150,"avatar_url":"https://avatars.githubusercontent.com/u/16065150?v=3","gravatar_id":"","url":"https://api.github.com/users/mlaventure","html_url":"https://github.com/mlaventure","followers_url":"https://api.github.com/users/mlaventure/followers","following_url":"https://api.github.com/users/mlaventure/following{/other_user}","gists_url":"https://api.github.com/users/mlaventure/gists{/gist_id}","starred_url":"https://api.github.com/users/mlaventure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlaventure/subscriptions","organizations_url":"https://api.github.com/users/mlaventure/orgs","repos_url":"https://api.github.com/users/mlaventure/repos","events_url":"https://api.github.com/users/mlaventure/events{/privacy}","received_events_url":"https://api.github.com/users/mlaventure/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/roadmap","name":"roadmap","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/53","html_url":"https://github.com/docker/docker/milestones/1.12.0","labels_url":"https://api.github.com/repos/docker/docker/milestones/53/labels","id":1657301,"number":53,"title":"1.12.0","description":"","creator":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"open_issues":33,"closed_issues":71,"state":"open","created_at":"2016-03-21T13:47:53Z","updated_at":"2016-05-19T22:59:40Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-05-19T22:59:40Z","updated_at":"2016-05-19T22:59:40Z","closed_at":null,"body":"# Goals\r\n\r\nNow that the actual creation of a container is handled by `runc` via `containerd`, it should technically be possible to swap out `runc` for any other binary providing they are exposing the same command line interface and accepting an OCI bundle. This could allow to use docker to manage more than containers (e.g. vms) and allow for users to use slightly different implementations than runc with added features.\r\n\r\n# Suggested Implementation\r\n\r\nThe proposed implementation would require users to register the runtimes they want to be available with the daemon. Once this is done, users would be able to select which runtime to use per container every time they start them. If no runtime are specified, the default one, which would ship with the docker official installation, will be used.\r\n\r\nIt should be possible for the user to define which runtime should be the `“default”` one, meaning which one is to be used if none is specified at container creation/start.\r\n\r\n# Runtime Registration\r\n\r\nIn order to expose available runtime to docker user, it is proposed to first have them register the available runtimes through docker either by a command line switch or via its configuration file (`daemon.json`).\r\n\r\n**Note**: the `“default”` name would be always reserved and mapped to the runtime coming with the docker package.\r\n\r\n## Command Line\r\n\r\nThe proposed switch option would be `--add-runtime` followed by a tuple `<runtime-name>:<runtime-path>`.\r\n\r\ne.g. `docker daemon --add-runtime=”oci:/usr/local/sbin/runc” --add-runtime=”vm:/usr/local/bin/vm-manager”`\r\n\r\n## Daemon Configuration\r\n\r\nThe daemon.json configuration would accept a new runtimes field as follow:\r\n\r\n```json\r\n{\r\n  \"runtimes\": {\r\n    \"oci\": {\r\n      \"path\": \"/usr/bin/docker-runc\",\r\n      \"runtimeArgs\": [\r\n        \"--debug\"\r\n      ]\r\n    },\r\n    \"vm\": {\r\n      \"path\": \"/usr/local/bin/vm-manager\",\r\n      \"runtimeArgs\": [\r\n        \"--debug\"\r\n      ]\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nThis format as the ability to also allow specifying extra runtime arguments compared to the command line version.\r\n\r\n## Runtimes list\r\n\r\nA list of available runtimes would be returned via the `info` endpoint (and displayed by `docker info`). That list would only include the runtimes name/alias (i.e. only the map keys are returned).\r\n\r\n# Default Runtime\r\n\r\nTo allow the user to define a different “default” runtime (as a separate attribute, not as a name). The following interfaces could be used.\r\n\r\n## Command Line\r\n\r\nA new `--default-runtime=”<runtime-name>”` would be added. `<runtime-name>` would have to be one of the name added via the `--add-runtime` flag described above. To revert to the runtime shipped by docker, a user would simply have to pass the value `“default”` to the flag.\r\n\r\ne.g. `docker daemon --add-runtime=”oci:/usr/local/sbin/runc” --add-runtime=”vm:/usr/local/bin/vm-manager” --default-runtime=\"vm\"`\r\n\r\n## Daemon Configuration\r\n\r\nThe default runtime would be stored in a new `“default-runtime”` attribute in `daemon.json`:\r\n\r\n```json\r\n{\r\n  \"defaultRuntime\": \"vm\",\r\n  \"runtimes\": {\r\n    \"oci\": {\r\n      \"path\": \"/usr/bin/docker-runc\",\r\n      \"runtimeArgs\": [\r\n        \"--debug\"\r\n      ]\r\n    },\r\n    \"vm\": {\r\n      \"path\": \"/usr/local/bin/vm-manager\",\r\n      \"runtimeArgs\": [\r\n        \"--debug\"\r\n      ]\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n# Container runtime selection\r\n\r\nExplicitly selecting a runtime at container start would be done using the new  `--runtime` flag:\r\n\r\n`docker start <start-options> --runtime=vm <container-name>`\r\n\r\n# Container State\r\n\r\n## Option 1: Included\r\n\r\nThe last used runtime would be stored on disk within the container config (the whole tuple `<name>:<path>`). Meaning, the next time the container is started without a `--runtime` argument, the old value would be used. \r\n\r\nIn the case where the runtime is no longer registered with the daemon, an error shall be displayed so the user can correctly specify a correct runtime.\r\n\r\nThis option would also allow to specify this flag at container creation instead (i.e. `docker create`) to be used as the default every time a container get started.\r\n\r\n## Option 2: Not Included\r\n\r\nIf we choose not to persist that choice on the disk, a next start of the container would revert to the default runtime if no runtime is specified\r\n\r\n# Limitations\r\n\r\nThis added options would not be available on Windows\r\n"}}
{"actor":{"display_login":"mlaventure"}}