@@ -11,7 +11,7 @@ redirect_from:
1111
1212After you
1313[ install Docker] ( /install/index.md ) , you can
14- [ install the Go and Python SDKs ] ( /develop /sdk/index.md#install-the-sdks ) and
14+ [ install the Go or Python SDK ] ( /engine/api /sdk/index.md#install-the-sdks ) and
1515also try out the Docker Engine API.
1616
1717Each of these examples show how to perform a given Docker operation using the Go
@@ -40,13 +40,14 @@ command prompt:
4040package main
4141
4242import (
43- " os "
43+ " context "
4444 " io"
45+ " os"
46+
4547 " github.com/docker/docker/api/types"
4648 " github.com/docker/docker/api/types/container"
47- " github.com/docker/docker/pkg/stdcopy"
4849 " github.com/docker/docker/client"
49- " golang.org/x/net/context "
50+ " github.com/docker/docker/pkg/stdcopy "
5051)
5152
5253func main () {
@@ -144,14 +145,14 @@ You can also run containers in the background, the equivalent of typing
144145package main
145146
146147import (
148+ " context"
147149 " fmt"
148150 " io"
149151 " os"
150152
151153 " github.com/docker/docker/api/types"
152154 " github.com/docker/docker/api/types/container"
153155 " github.com/docker/docker/client"
154- " golang.org/x/net/context"
155156)
156157
157158func main () {
@@ -230,11 +231,11 @@ You can use the API to list containers that are running, just like using
230231package main
231232
232233import (
234+ " context"
233235 " fmt"
234236
235237 " github.com/docker/docker/api/types"
236238 " github.com/docker/docker/client"
237- " golang.org/x/net/context"
238239)
239240
240241func main () {
@@ -306,11 +307,11 @@ This example stops all running containers.
306307package main
307308
308309import (
310+ " context"
309311 " fmt"
310312
311313 " github.com/docker/docker/api/types"
312314 " github.com/docker/docker/client"
313- " golang.org/x/net/context"
314315)
315316
316317func main () {
@@ -386,12 +387,12 @@ to change the hard-coded ID of the container to print the logs for.
386387package main
387388
388389import (
390+ " context"
389391 " io"
390392 " os"
391393
392394 " github.com/docker/docker/api/types"
393395 " github.com/docker/docker/client"
394- " golang.org/x/net/context"
395396)
396397
397398func main () {
@@ -456,11 +457,11 @@ List the images on your Engine, similar to `docker image ls`:
456457package main
457458
458459import (
460+ " context"
459461 " fmt"
460462
461463 " github.com/docker/docker/api/types"
462464 " github.com/docker/docker/client"
463- " golang.org/x/net/context"
464465)
465466
466467func main () {
@@ -526,12 +527,12 @@ Pull an image, like `docker pull`:
526527package main
527528
528529import (
530+ " context"
529531 " io"
530532 " os"
531533
532534 " github.com/docker/docker/api/types"
533535 " github.com/docker/docker/client"
534- " golang.org/x/net/context"
535536)
536537
537538func main () {
@@ -600,14 +601,14 @@ Pull an image, like `docker pull`, with authentication:
600601package main
601602
602603import (
604+ " context"
603605 " encoding/base64"
604606 " encoding/json"
605607 " io"
606608 " os"
607609
608610 " github.com/docker/docker/api/types"
609611 " github.com/docker/docker/client"
610- " golang.org/x/net/context"
611612)
612613
613614func main () {
@@ -699,12 +700,12 @@ Commit a container to create an image from its contents:
699700package main
700701
701702import (
703+ " context"
702704 " fmt"
703705
704706 " github.com/docker/docker/api/types"
705707 " github.com/docker/docker/api/types/container"
706708 " github.com/docker/docker/client"
707- " golang.org/x/net/context"
708709)
709710
710711func main () {
0 commit comments