I have docker 20.10.21 installed from apt. The machine is not directly connected to the internet so we rely on our squid proxy.
I have set up a daemon.json file:
rful011@secphires01:~$ cat /etc/docker/daemon.json
{
"http-proxy": "http://squid.auckland.ac.nz:3128",
"https-proxy": "http://squid.auckland.ac.nz:3128",
"no-proxy": "*.auckland.ac.nz"
}
as described here.
starting dockerd gives:
rful011@secphires01:~$ sudo /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives don't match any configuration option: no-proxy, http-proxy, https-proxy
Clearly I am missing something.
Ubuntu 20.04 ships Docker in version 20.10.
According to the documentation you need at least 23.0 to configure the proxy this way:
So you either need to install a newer Docker version or you need to use environment variables.
You can use
sudo systemctl edit docker
to create a systemd drop in and configure environment variables there.