mirror of https://github.com/docker/docs.git
Fix for tabs on Engine API
This commit is contained in:
parent
ff1f8b34be
commit
1cad0f77c2
|
@ -22,20 +22,20 @@ The API can be accessed with any HTTP client, but we also provide [SDKs](sdks.md
|
|||
|
||||
As an example, the `docker run` command can be easily implemented in various programming languages and by hitting the API directly with `curl`:
|
||||
|
||||
<dl class="horizontal tabs" data-tab>
|
||||
<dd class="active"><a href="#tab-python" class="noanchor">Python</a></dd>
|
||||
<dd><a href="#tab-go" class="noanchor">Go</a></dd>
|
||||
<dd><a href="#tab-curl" class="noanchor">curl</a></dd>
|
||||
</dl>
|
||||
<div class="tabs-content">
|
||||
<section class="content active" id="tab-python">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a data-toggle="tab" href="#python">Python</a></li>
|
||||
<li><a data-toggle="tab" href="#go">Go</a></li>
|
||||
<li><a data-toggle="tab" href="#curl">curl</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="python" class="tab-pane fade in active">
|
||||
{% highlight python %}
|
||||
import docker
|
||||
client = docker.from_env()
|
||||
print client.containers.run("alpine", ["echo", "hello", "world"])
|
||||
{% endhighlight %}
|
||||
</section>
|
||||
<section class="content" id="tab-go">
|
||||
</div>
|
||||
<div id="go" class="tab-pane fade">
|
||||
{% highlight go %}
|
||||
package main
|
||||
|
||||
|
@ -85,8 +85,8 @@ func main() {
|
|||
io.Copy(os.Stdout, out)
|
||||
}
|
||||
{% endhighlight %}
|
||||
</section>
|
||||
<section class="content" id="tab-curl">
|
||||
</div>
|
||||
<div id="curl" class="tab-pane fade">
|
||||
{% highlight bash %}
|
||||
$ curl --unix-socket /var/run/docker.sock -H "Content-Type: application/json" \
|
||||
-d '{"Image": "alpine", "Cmd": ["echo", "hello world"]}' \
|
||||
|
@ -101,7 +101,7 @@ $ curl --unix-socket /var/run/docker.sock -X POST http:/v1.24/containers/1c6594f
|
|||
$ curl --unix-socket /var/run/docker.sock "http:/v1.24/containers/1c6594faf5/logs?stdout=1"
|
||||
hello world
|
||||
{% endhighlight %}
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
To learn more, take a look at the [getting started guide](getting-started.md)
|
||||
|
|
Loading…
Reference in New Issue