Score:0

using docker on linux with squid proxy. -- ubuntu 20.04

hk flag

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.

in flag
Docker 1.5? The docker shipped with Ubuntu is version 20.10.
Russell Fulton avatar
hk flag
my mistake -- I was looking at the version given by `apt show docker`. docker -v gives 20.10.21
Score:1
in flag

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:

The daemon can be configured in three ways:

  • Using environment variables (HTTP_PROXY, HTTPS_PROXY, and NO_PROXY).
  • Using the “http-proxy”, “https-proxy”, and “no-proxy” fields in the daemon configuration file (Docker Engine 23.0 or newer).
  • Using the --http-proxy, --https-proxy, and --no-proxy command-line options. (Docker Engine 23.0 or newer).

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.

Russell Fulton avatar
hk flag
I created a `/etc/default/docker' and then used `sudo systemctl edit docker` to add `EnvronmentFile` entry
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.