Looking at docs there is no instruction on how to run it behind a proxy. https://docs.docker.com/installation/ubuntulinux/
Reading on forums, the instruction is to updat
systemctl will have to installed, which can be problematic. In case /etc/systemd/system/docker.service.d/http-proxy.conf or /etc/default/docker solution does not work for you, simply use the below command:
docker build [OPTIONS] PATH --build-arg http_proxy=http://your.proxy:port --build-arg https_proxy=http://your.proxy:port --build-arg no_proxy=.internal.domain,localhost,127.0.0.1