Skip to content

Commit

Permalink
Change APT to use mirror protocol
Browse files Browse the repository at this point in the history
As part of the setup script, set APT to use the mirror protocol so
that no matter where you are in the world, the closest mirror to you
will be chosen. If you don't reside in the US it can be slow to
download all the packages when building images. This will mean the
best mirrors will be chosen regardless of the developer's location.

Change-Id: Iadda26f38aad8526219da2e4ef0fd66150004829
Signed-off-by: Julian Carrivick <cjulian@au1.ibm.com>
  • Loading branch information
juliancarrivick-ibm committed Aug 23, 2016
1 parent 061e064 commit d6d9d28
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/provision/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

# Add any logic that is common to both the peer and docker environments here

# Use the mirror protocol for apt so that geographically close mirrors are automatically chosen
source /etc/lsb-release

cat <<EOF > /etc/apt/sources.list
deb mirror://mirrors.ubuntu.com/mirrors.txt $DISTRIB_CODENAME main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt $DISTRIB_CODENAME-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt $DISTRIB_CODENAME-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt $DISTRIB_CODENAME-security main restricted universe multiverse
EOF

apt-get update -qq

# Used by CHAINTOOL
Expand Down

0 comments on commit d6d9d28

Please sign in to comment.