Skip to content

Instantly share code, notes, and snippets.

@kadel
Last active March 29, 2016 12:25
Show Gist options
  • Select an option

  • Save kadel/a9ef34063d14273171f8 to your computer and use it in GitHub Desktop.

Select an option

Save kadel/a9ef34063d14273171f8 to your computer and use it in GitHub Desktop.
Vagrantfile - add registry mirror
config.vm.provision "shell", inline: <<-SHELL
if ! grep -q 'registry-mirror' /etc/sysconfig/docker; then
sed -i "s/^OPTIONS=\\"/OPTIONS=\\"--registry-mirror=http:\\/\\/10.1.2.1:5000 /g" /etc/sysconfig/docker
sed -i "s/^\\# INSECURE_REGISTRY='.*/INSECURE_REGISTRY=\\"--insecure-registry=10.1.2.1:5000\\" /g" /etc/sysconfig/docker
echo "restarting docker"
systemctl restart docker
fi
SHELL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment