ERROR Docker Engine API on Mac Osx

    according to the official document docker desktop on MAC vs. docker toolbox, docker desktop on Mac only provides UNIX socket/var/run/docker.socket, and does not provide TCP listening (default 2375 port). If you configure host in docker desktop using the configuration method of Linux, Docker desktop cannot be started. You need to delete the hosts configuration in ~ /. Docker/daemon.json to start normally. The following method exposes 2375 TCP

    docker run --rm -d -v /var/run/docker.sock:/var/run/docker.sock -p 127.0.0.1:2375:2375 bobrik/socat TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock
    
      then view the current docker engine version through docker version, such as 1.40. View the official engine API document: https://docs.docker.com/engine/api Search for an image to test:

      $curl -XGET http://127.0.0.1:2375/version | python -mjson.tool
      
      {
          "ApiVersion": "1.41",
          "Arch": "amd64",
          "BuildTime": "2021-07-30T19:52:10.000000000+00:00",
          "Components": [
              {
                  "Details": {
                      "ApiVersion": "1.41",
                      "Arch": "amd64",
                      "BuildTime": "2021-07-30T19:52:10.000000000+00:00",
                      "Experimental": "false",
                      "GitCommit": "75249d8",
                      "GoVersion": "go1.16.6",
                      "KernelVersion": "5.10.47-linuxkit",
                      "MinAPIVersion": "1.12",
                      "Os": "linux"
                  },
                  "Name": "Engine",
                  "Version": "20.10.8"
              },
              {
                  "Details": {
                      "GitCommit": "e25210fe30a0a703442421b0f60afac609f950a3"
                  },
                  "Name": "containerd",
                  "Version": "1.4.9"
              },
              {
                  "Details": {
                      "GitCommit": "v1.0.1-0-g4144b63"
                  },
                  "Name": "runc",
                  "Version": "1.0.1"
              },
              {
                  "Details": {
                      "GitCommit": "de40ad0"
                  },
                  "Name": "docker-init",
                  "Version": "0.19.0"
              }
          ],
          "GitCommit": "75249d8",
          "GoVersion": "go1.16.6",
          "KernelVersion": "5.10.47-linuxkit",
          "MinAPIVersion": "1.12",
          "Os": "linux",
          "Platform": {
              "Name": "Docker Engine - Community"
          },
          "Version": "20.10.8"
      }
      

Read More: