2014年9月29日月曜日

vagrant-proxyconf(1.4.0) supports docker (en)

Hello, proxy fans in the world,

Finally,vagrant-proxyconfdocker has been released!(version 1.4.0).So, you can run docker easily behind a corporate proxy.

docker

You can use vagrant-proxy docker support for docker hosts on ubuntu, RHEL(6,7), CoreOS, boot2docker and so on.

It is easy to use. Install vagrant-proxyconf, then add your proxy configuration to Vagrantfile. If you already use vagrant-proxyconf, you don't need extra configuration for vagrant-proxy docker support.

vagrant-proxyconf installation

Install vagrant-proxyconf

$ vagrant plugin install vagrant-proxyconf
Installing the 'vagrant-proxyconf' plugin. This can take a few minutes...
Installed the plugin 'vagrant-proxyconf (1.4.0)'!
$ 

If you can't install vagrant plugin because of proxy server. Try the followings.

$ http_proxy=http://myproxy:3128/ vagrant plugin install vagrant-proxyconf
Installing the 'vagrant-proxyconf' plugin. This can take a few minutes...
Installed the plugin 'vagrant-proxyconf (1.4.0)'!
$ 

Vagrantfile

Add configuration.

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  if Vagrant.has_plugin?("vagrant-proxyconf")
    config.proxy.http     = "http://myproxy:3128/"
    config.proxy.no_proxy = "localhost,127.0.0.1,.example.com"
  end
  # ... other stuff
end

Running docker

After vagrant up, try to run docker.

vagrant@vagrant-ubuntu-trusty-64:~$ sudo docker.io pull -t 14.04 ubuntu 
Pulling repository ubuntu
ad892dd21d60: Download complete 
vagrant@vagrant-ubuntu-trusty-64:~$ 

If you set http_proxy, it will affect for https communication for docker. You can use private repositories in your intranet, because you can set no_proxy.
docker/registry/registry.go
docker/registry/auth.go
The Go Programming Language Source file src/pkg/net/http/transport.go

Happy proxy life!!

Docker logo and marks usage

0 件のコメント:

コメントを投稿