Allow use of mirrors when building Ubuntu images
Add a script to ubuntu's pre-install.d that will change archive.ubuntu.com to a mirror specified in $DIB_DISTRIBUTION_MIRROR. Change-Id: Idfd5a40ec8a1912a5de5dcdcaf9795946b0b53b8
This commit is contained in:
parent
d0fd8915f6
commit
48f5359efb
@ -6,3 +6,5 @@ Overrides:
|
|||||||
use the environment variable DIB\_CLOUD\_IMAGES
|
use the environment variable DIB\_CLOUD\_IMAGES
|
||||||
* To download a non-default release of Ubuntu cloud images, use the
|
* To download a non-default release of Ubuntu cloud images, use the
|
||||||
environment variable DIB\_RELEASE
|
environment variable DIB\_RELEASE
|
||||||
|
* To use a different mirror rather than archive.ubuntu.com, use the
|
||||||
|
environment variable DIB\_DISTRIBUTION\_MIRROR
|
||||||
|
10
elements/ubuntu/pre-install.d/01-set-ubuntu-mirror
Executable file
10
elements/ubuntu/pre-install.d/01-set-ubuntu-mirror
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-}
|
||||||
|
|
||||||
|
[ -n "$DIB_DISTRIBUTION_MIRROR" ] || exit 0
|
||||||
|
|
||||||
|
sudo sed -ie "s&http://archive.ubuntu.com/ubuntu&$DIB_DISTRIBUTION_MIRROR&" \
|
||||||
|
/etc/apt/sources.list
|
Loading…
Reference in New Issue
Block a user