一、问题现象:

docker环境 traefik 报错

reverse-proxy-1 | 2025-11-12T00:53:50Z ERR Provider error, retrying in 507.487352ms error=“Error response from daemon: client version 1.24 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version” providerName=docker

二、问题原因

traefik使用的API版本是1.24, docker升级到29之后,默认的最低版本比1.24高。所以traefik无法正常使用

三、解决办法

1. 等待后续traefik版本

(文章编写时的traefik未3.6.0,无法正常使用)

2. 降低docker-ce版本

不升级docker engine 版本到29

3. 修改环境变量(推荐暂时使用,等待traefik更新)

  • 优点:简单,省事儿。修改起来也不复杂

  • 缺点:后续docker-ce每次更新,都会重写生成文件,所以我们每次都需要按此步骤操作一遍。

将docker 服务的环境变量添加DOCKER_MIN_API_VERSION=1.24,linux修改步骤如下

  1. vi /usr/lib/systemd/system/docker.service 编辑服务文件
    [Unit]
    Description=Docker Application Container Engine
    Documentation=https://docs.docker.com
    After=network-online.target nss-lookup.target docker.socket firewalld.service containerd.service time-set.target
    Wants=network-online.target containerd.service
    Requires=docker.socket
    StartLimitBurst=3
    StartLimitIntervalSec=60
    
    [Service]
    Environment=DOCKER_MIN_API_VERSION=1.24    ######## 新增这一行
    Type=notify
    # the default is not to use systemd for cgroups because the delegate issues still
    # exists and systemd currently does not support the cgroup feature set required
    # for containers run by docker
    ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
    ExecReload=/bin/kill -s HUP $MAINPID
    TimeoutStartSec=0
    RestartSec=2
    Restart=always
    
    # Having non-zero Limit*s causes performance problems due to accounting o
    ........#下边还有很多,略
  1. 然后 执行 systemctl daemon-reload ,重写加载服务文件,

  2. 重启docker systemctl restart docker.service 。然后大功告成!

Logo

欢迎加入DeepSeek 技术社区。在这里,你可以找到志同道合的朋友,共同探索AI技术的奥秘。

更多推荐