How to set correct proxy for docker daemon

Hi, everyone:

I used this to set proxy,

cat /etc/docker/daemon.json

{
    "proxies": {
        "http-Proxy": "http://127.0.0.1:7890",
        "https-Proxy": "http://127.0.0.1:7890",
        "no-Proxy": "localhost,127.0.0.1,*.test.example.com,.example.org,127.0.0.0/8"
   }
}

After restart docker service, failed, logs

Failed to start docker.service - Docker Application Container Engine.
May 15 11:24:29 debian systemd[1]: Starting docker.service - Docker Application Container Engine...
May 15 11:24:29 debian dockerd[2283244]: unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives don't match any configuration option: http-Proxy, https-Proxy, no-Proxy
May 15 11:24:29 debian systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
May 15 11:24:29 debian systemd[1]: docker.service: Failed with result 'exit-code'.

BTW,

docker version

Docker version 20.10.24+dfsg1, build 297e128

OS:

Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm

What should I do next?

Thanks,

Best Regards,
Chase

resolve for me:

Environment variables

You are using a docker package from the distro repositories.

Vanilla docker behavior is only guaranteed if you run the official docker packages from docker’s own repositories on supported platforms:
https://docs.docker.com/engine/install/#supported-platforms

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.