-
-
Save xnohat/15deebc396c7179755890442e1aa7ad1 to your computer and use it in GitHub Desktop.
[ubuntu|docker]auto select fastest apt mirror
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu | |
RUN apt-get update -y \ | |
&& apt-get install -y wget \ | |
&& wget -O netselect.deb http://http.us.debian.org/debian/pool/main/n/netselect/netselect_0.3.ds1-28+b1_`dpkg --print-architecture`.deb \ | |
&& dpkg -i netselect.deb \ | |
&& rm netselect.deb \ | |
&& sed -r -i -e "s#http://(archive|security)\.ubuntu\.com/ubuntu/?#$(netselect -v -s1 -t20 `wget -q -O- https://launchpad.net/ubuntu/+archivemirrors | grep -P -B8 "statusUP|statusSIX" | grep -o -P "http://[^\"]*"`|grep -P -o 'http://.+$')#g" /etc/apt/sources.list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment