diff --git a/.gitignore b/.gitignore index f792599..d1b27bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ play-with-docker node_modules -docker-compose.single.yml -lala +vendor diff --git a/Dockerfile b/Dockerfile index 5f06e3f..c5d1447 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.8 +FROM golang:1.9 COPY . /go/src/github.com/play-with-docker/play-with-docker diff --git a/docker/docker.go b/docker/docker.go index 70b9cca..1b6e1dc 100644 --- a/docker/docker.go +++ b/docker/docker.go @@ -14,13 +14,13 @@ import ( "strings" "time" - "github.com/docker/distribution/reference" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/api/types/volume" - "github.com/docker/docker/client" + client "docker.io/go-docker" + "docker.io/go-docker/api/types" + "docker.io/go-docker/api/types/container" + "docker.io/go-docker/api/types/network" + "docker.io/go-docker/api/types/swarm" + "docker.io/go-docker/api/types/volume" + "github.com/containerd/containerd/reference" "github.com/docker/docker/pkg/jsonmessage" "github.com/play-with-docker/play-with-docker/config" ) @@ -398,7 +398,7 @@ func (d *docker) GetContainerIPs(id string) (map[string]string, error) { } func (d *docker) pullImage(ctx context.Context, image string) error { - _, err := reference.ParseNormalizedNamed(image) + _, err := reference.Parse(image) if err != nil { return err } @@ -431,7 +431,7 @@ func (d *docker) ExecAttach(instanceName string, command []string, out io.Writer if err != nil { return 0, err } - resp, err := d.c.ContainerExecAttach(context.Background(), e.ID, types.ExecStartCheck{Tty: true}) + resp, err := d.c.ContainerExecAttach(context.Background(), e.ID, types.ExecConfig{AttachStdout: true, AttachStderr: true, Tty: true}) if err != nil { return 0, err } diff --git a/docker/factory.go b/docker/factory.go index f230d51..36e441c 100644 --- a/docker/factory.go +++ b/docker/factory.go @@ -8,8 +8,8 @@ import ( "net/url" "time" - "github.com/docker/docker/api" - "github.com/docker/docker/client" + "docker.io/go-docker/api" + client "docker.io/go-docker" "github.com/docker/go-connections/tlsconfig" "github.com/play-with-docker/play-with-docker/pwd/types" "github.com/play-with-docker/play-with-docker/router" diff --git a/docker/local_cached_factory.go b/docker/local_cached_factory.go index 89bcde6..1cb665f 100644 --- a/docker/local_cached_factory.go +++ b/docker/local_cached_factory.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/docker/docker/client" + client "docker.io/go-docker" "github.com/play-with-docker/play-with-docker/pwd/types" "github.com/play-with-docker/play-with-docker/storage" ) diff --git a/docker/mock.go b/docker/mock.go index 0959134..024918d 100644 --- a/docker/mock.go +++ b/docker/mock.go @@ -5,8 +5,8 @@ import ( "net" "time" - "github.com/docker/docker/api/types" - "github.com/docker/docker/client" + "docker.io/go-docker/api/types" + client "docker.io/go-docker" "github.com/stretchr/testify/mock" ) diff --git a/provisioner/overlay.go b/provisioner/overlay.go index 23d415e..a6c8121 100644 --- a/provisioner/overlay.go +++ b/provisioner/overlay.go @@ -6,7 +6,7 @@ import ( "net/url" "strings" - dtypes "github.com/docker/docker/api/types" + dtypes "docker.io/go-docker/api/types" "github.com/play-with-docker/play-with-docker/config" "github.com/play-with-docker/play-with-docker/docker" "github.com/play-with-docker/play-with-docker/pwd/types" diff --git a/pwd/client_test.go b/pwd/client_test.go index 237c734..88ed666 100644 --- a/pwd/client_test.go +++ b/pwd/client_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - dtypes "github.com/docker/docker/api/types" + dtypes "docker.io/go-docker/api/types" "github.com/play-with-docker/play-with-docker/config" "github.com/play-with-docker/play-with-docker/docker" "github.com/play-with-docker/play-with-docker/event" diff --git a/pwd/instance_test.go b/pwd/instance_test.go index e8277ef..2fa3bb0 100644 --- a/pwd/instance_test.go +++ b/pwd/instance_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - dtypes "github.com/docker/docker/api/types" + dtypes "docker.io/go-docker/api/types" "github.com/play-with-docker/play-with-docker/config" "github.com/play-with-docker/play-with-docker/docker" "github.com/play-with-docker/play-with-docker/event" diff --git a/pwd/session_test.go b/pwd/session_test.go index ab07e1b..ffec01a 100644 --- a/pwd/session_test.go +++ b/pwd/session_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - dtypes "github.com/docker/docker/api/types" + dtypes "docker.io/go-docker/api/types" "github.com/play-with-docker/play-with-docker/config" "github.com/play-with-docker/play-with-docker/docker" "github.com/play-with-docker/play-with-docker/event" diff --git a/router/l2/l2.go b/router/l2/l2.go index 3582330..a41ba0c 100644 --- a/router/l2/l2.go +++ b/router/l2/l2.go @@ -10,10 +10,10 @@ import ( "os" "time" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/client" + "docker.io/go-docker/api/types" + "docker.io/go-docker/api/types/filters" + "docker.io/go-docker/api/types/network" + client "docker.io/go-docker" "github.com/gorilla/mux" "github.com/play-with-docker/play-with-docker/config" "github.com/play-with-docker/play-with-docker/router" diff --git a/scheduler/task/check_swarm_ports_test.go b/scheduler/task/check_swarm_ports_test.go index c7cb05d..23cedd8 100644 --- a/scheduler/task/check_swarm_ports_test.go +++ b/scheduler/task/check_swarm_ports_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - dockerTypes "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/swarm" + dockerTypes "docker.io/go-docker/api/types" + "docker.io/go-docker/api/types/swarm" "github.com/play-with-docker/play-with-docker/docker" "github.com/play-with-docker/play-with-docker/event" "github.com/play-with-docker/play-with-docker/pwd/types" diff --git a/scheduler/task/check_swarm_status.go b/scheduler/task/check_swarm_status.go index 06b8ecf..a5fd9a2 100644 --- a/scheduler/task/check_swarm_status.go +++ b/scheduler/task/check_swarm_status.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/docker/docker/api/types/swarm" + "docker.io/go-docker/api/types/swarm" "github.com/play-with-docker/play-with-docker/docker" "github.com/play-with-docker/play-with-docker/event" "github.com/play-with-docker/play-with-docker/pwd/types" diff --git a/scheduler/task/check_swarm_status_test.go b/scheduler/task/check_swarm_status_test.go index ec2fe16..0e1ba3c 100644 --- a/scheduler/task/check_swarm_status_test.go +++ b/scheduler/task/check_swarm_status_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - dockerTypes "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/swarm" + dockerTypes "docker.io/go-docker/api/types" + "docker.io/go-docker/api/types/swarm" "github.com/play-with-docker/play-with-docker/docker" "github.com/play-with-docker/play-with-docker/event" "github.com/play-with-docker/play-with-docker/pwd/types" diff --git a/scheduler/task/collect_stats.go b/scheduler/task/collect_stats.go index 4fb3249..5ed012a 100644 --- a/scheduler/task/collect_stats.go +++ b/scheduler/task/collect_stats.go @@ -10,7 +10,7 @@ import ( "net/url" "time" - dockerTypes "github.com/docker/docker/api/types" + dockerTypes "docker.io/go-docker/api/types" units "github.com/docker/go-units" lru "github.com/hashicorp/golang-lru" "github.com/play-with-docker/play-with-docker/docker" diff --git a/scheduler/task/collect_stats_test.go b/scheduler/task/collect_stats_test.go index 443a1b6..17df434 100644 --- a/scheduler/task/collect_stats_test.go +++ b/scheduler/task/collect_stats_test.go @@ -7,7 +7,7 @@ import ( "io" "testing" - dockerTypes "github.com/docker/docker/api/types" + dockerTypes "docker.io/go-docker/api/types" "github.com/play-with-docker/play-with-docker/docker" "github.com/play-with-docker/play-with-docker/event" "github.com/play-with-docker/play-with-docker/pwd/types"