<p>I've been using <code>kubectl -vvvv ...</code> a lot to learn about the different HTTP requests sent to the API server for different commands.</p>
<p>However, I cannot seem to find a way of achieving the same with <code>docker</code>.</p>
<p>In particular, I've considered <code>docker --debug ...</code>, but e.g. <code>docker --debug ps</code> just displays the normal output.</p>
<p>How can I make <code>docker</code> output the HTTP requests sent to the daemon?</p>

<blockquote>
<p>How can I make docker output the HTTP requests sent to the daemon?</p>
</blockquote>
<p>You can't, but you can set up a proxy server between the client and the docker daemon so that you can see the requests. The <code>socat</code> tool is useful for this. Set up a proxy by running:</p>
<pre><code>socat -v unix-listen:/tmp/docker.sock,fork unix-connect:/var/run/docker.sock
</code></pre>
<p>And then point <code>docker</code> at the proxy:</p>
<pre><code>docker -H unix:///tmp/docker.sock ps
</code></pre>
<p>As you make requests with <code>docker</code>, you'll see the requests and replies in the output from the <code>socat</code> command.</p>
<p>(You can set the <code>DOCKER_HOST</code> environment variable if you get tired of typing the <code>-H ...</code> command line option.)</p>
