<p dir="auto">We propose to add a <code class="notranslate">pod/dockercmd</code> subresource, so that user can run some userful docker command on his container, such as commit the image of his container by running <code class="notranslate">docker commit</code>.</p>
<p dir="auto">By now, k8s just support the <code class="notranslate">docker logs</code> and <code class="notranslate">docker attach</code>command by the <code class="notranslate">pod/log</code> and <code class="notranslate">pod/attach</code> subresource. Our idea is to add a general <code class="notranslate">pod/dockercmd</code> subresource to support more useful docker commands(and disable some dangerous commands such as <code class="notranslate">docker stop</code>), the existing <code class="notranslate">pod/log</code> and <code class="notranslate">pod/attache</code> subresource can be deprecated after the <code class="notranslate">pod/dockercmd</code> subresource is supported.</p>
<p dir="auto">Such a way is much more extensible: if we want support another docker command in the future, just add it to the "whitelist", instead of adding a new subresource and duplicating a lot of code.</p>
<p dir="auto">Any comment is welcomed.</p>
<p dir="auto">Passed on kubernetes-test-go 3-4 times, and then failed:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TestGC

gc_controller_test.go:122: [1]pod's deleted expected and actual did not match.
expected: [a]
actual: [b]"><pre class="notranslate"><code class="notranslate">TestGC

gc_controller_test.go:122: [1]pod's deleted expected and actual did not match.
expected: [a]
actual: [b]
</code></pre></div>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/brendandburns/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/brendandburns">@brendandburns</a></p>