In my team our CI server builds docker images that are pushed to a private 
registry (Quay.io, sort of a github/bitbucket for docker repos). Then, any 
dev can download those images doing "docker pull quay.io/myorg/myrepo", 
provided they have logged in or have a .dockercfg file in their home folder.

I'm building a Vagrantfile that will pull a bunch of images from quay.io 
and run a number of containers upon boot, using the Docker provisioner:

VAGRANTFILE_API_VERSION = "2"
>
> Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
>
>   config.vm.box = "hashicorp/precise64"
>   # Set up env vars to be used by the containers
>
>   # Copy quay.io credentials
>   config.vm.provision "file" do |f|
>     f.source = ".dockercfg"
>     f.destination = ".dockercfg"
>   end
>
>   # Install docker, pull images, and run containers!
>   config.vm.provision "docker" do |d|
>     d.pull_images "quay.io/myteam/myrepo"
>     d.pull_images "quay.io/myteam/mysecondrepo"
>   end
> end
>

The vagrant provision fails with a 403 error (can't login to quay.io), but 
when I login to the machine (vagrant ssh) and run "docker pull 
quay.io/myteam/myrepo", the image gets pulled without issues. I think it's 
related to the fact that the Docker provisioner runs all commands with sudo.

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to