Upgrade docker sdk to moby (#491)

* Replace deprecated method

* Upgrade docker sdk to moby
This commit is contained in:
Stavros Panakakis
2021-09-07 14:03:13 +03:00
committed by GitHub
parent 94ec06a3fe
commit 3ee2975d76
17 changed files with 39 additions and 38 deletions

View File

@@ -6,7 +6,7 @@ import (
"net/http"
"time"
docker "docker.io/go-docker"
"github.com/docker/docker/client"
"github.com/play-with-docker/play-with-docker/config"
"github.com/shirou/gopsutil/load"
)
@@ -15,7 +15,7 @@ func Ping(rw http.ResponseWriter, req *http.Request) {
defer latencyHistogramVec.WithLabelValues("ping").Observe(float64(time.Since(time.Now()).Nanoseconds()) / 1000000)
// Get system load average of the last 5 minutes and compare it against a threashold.
c, err := docker.NewEnvClient()
c, err := client.NewClientWithOpts()
if err != nil {
rw.WriteHeader(http.StatusInternalServerError)