Change Sources of Ubuntu in a Docker image

Jul 7, 2015 · 67 words · 1 minute read docker

The official docker images of Ubuntu use as the default package source.

Because my Internet connection is metered, I’d like to change it to the free mirror server my ISP provides.

And this command does the trick:

sed -i 's/http:\/\/\/\/\/pub\/ubuntu/g' /etc/apt/sources.list

Change to the url of whatever mirror you prefer.

And add RUN to the start of the line and put it into the Dockerfile.

tweet Share