Skip to content

Instantly share code, notes, and snippets.

@yushijinhun
Created July 31, 2017 12:36
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save yushijinhun/32ffabc9d63f4e990f00c94038f54ee7 to your computer and use it in GitHub Desktop.
[ubuntu|docker]auto select fastest apt mirror
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
@baltuonis
Copy link

Unterminated quoted string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment