Apt proxy fallback option added as a config file parameter.
If configured to use direct connection as a fallback, the script will test connectivity with the proxy server each time before using it via a bash function for debootstrap and via apt.conf.d/52fallback file on chroot.
If fallback is configured, the old 51cache file will not be installed.
export-image stage removes all installed files related to this functionality.
Testing this script on Debian buster with the following config file in 4 different scenarios worked fine for me. I tried it while the proxy is down all the time, up all the time, changed state from up to down and down to up during build. Script used proxy whenever it is available in all of these scenarios.
Apt proxy fallback option added as a config file parameter. If configured to use direct connection as a fallback, the script will test connectivity with the proxy server each time before using it via a bash function for debootstrap and via apt.conf.d/52fallback file on chroot.
If fallback is configured, the old 51cache file will not be installed.
export-image stage removes all installed files related to this functionality.
Testing this script on Debian buster with the following config file in 4 different scenarios worked fine for me. I tried it while the proxy is down all the time, up all the time, changed state from up to down and down to up during build. Script used proxy whenever it is available in all of these scenarios.
IMG_NAME='ProxyTest' APT_PROXY=http://10.0.2.3:3142/ APT_PROXY_FALLBACK=1