[fix][ci] Pick ubuntu mirror that uses http://
@@ -57,8 +57,9 @@ function ci_pick_ubuntu_mirror() {
UBUNTU_MIRROR=$({
# choose mirrors that are up-to-date by checking the Last-Modified header for
{
- # randomly choose up to 10 mirrors
- curl -s http://mirrors.ubuntu.com/mirrors.txt | shuf -n 10
+ # randomly choose up to 10 mirrors using http:// protocol
+ # (https isn't supported in docker containers that don't have ca-certificates installed)
+ curl -s http://mirrors.ubuntu.com/mirrors.txt | grep '^http://' | shuf -n 10
# also consider Azure's Ubuntu mirror
echo http://azure.archive.ubuntu.com/ubuntu/
} | xargs -I {} sh -c 'echo "$(curl -m 5 -sI {}dists/$(lsb_release -c | cut -f2)-security/Contents-$(dpkg --print-architecture).gz|sed s/\\r\$//|grep Last-Modified|awk -F": " "{ print \$2 }" | LANG=C date -f- -u +%s)" "{}"' | sort -rg | awk '{ if (NR==1) TS=$1; if ($1 == TS) print $2 }'
