Assuming my Docker-Cache process is up and running and you are using Ubuntun based docker images.
At the top of the Docker file place this line
run echo "Acquire::http::Proxy \"http://proxy:3142\";" | tee /etc/apt/apt.conf.d/01proxy
When you run the container do
docker build --network proxy_default -t tim:1.0 /tim