docker_state_exporter
docker_state_exporter copied to clipboard
unsupported API ?
#docker version Client: Version: 19.03.6-ce API version: 1.40 Go version: go1.13.4 Git commit: 369ce74 Built: Fri May 29 04:01:26 2020 OS/Arch: linux/amd64 Experimental: false
Server: Engine: Version: 19.03.6-ce API version: 1.40 (minimum version 1.12) Go version: go1.13.4 Git commit: 369ce74 Built: Fri May 29 04:01:57 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.3.2 GitCommit: ff48f57fc83a8c44cf4ad5d672424a98ba37ded6 runc: Version: 1.0.0-rc10 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd docker-init: Version: 0.18.0 GitCommit: fec3683
error log: {"address":":8812","message":"Server listening...","severity":"info","timestamp":"2022-01-14T02:42:52.470521503Z"} {"message":"Error response from daemon: client version 1.41 is too new. Maximum supported API version is 1.40","severity":"error","timestamp":"2022-01-14T02:42:52.911369808Z"}
I have same issue
This is because the docker/docker/client
library is newer than the docker installation. We should probably enable auto-negotiation of the used api version: https://github.com/moby/moby/blob/master/client/client.go#L208
You can workaround the problem by explicitely defining the api version to use with an environment variable:
DOCKER_API_VERSION=1.40
您可以通过明确定义要与环境变量一起使用的 api 版本来解决此问题:
DOCKER_API_VERSION=1.40
thanks you .As you said, the problem has been solved
sudo docker run -d
-v "/var/run/docker.sock:/var/run/docker.sock"
-p 8080:8080
--env DOCKER_API_VERSION=1.40
karugaru/docker_state_exporter
-listen-address=:8080