machyve / xhyve

xhyve, a lightweight OS X virtualization solution
Other
6.44k stars 353 forks source link

Docker for mac is running on xhyve, so how to set proxy server in xhyve #102

Closed ozbillwang closed 8 years ago

ozbillwang commented 8 years ago

That's great.

Docker for Mac does not use VirtualBox, but rather xhyve, a lightweight OS X virtualization solution built on top of Hypervisor.framework in OS X 10.10 Yosemite and higher.

So how to set proxy server in xhyve?

ozbillwang commented 8 years ago

By the way, how to pronounce this product - xhyve?

xez commented 8 years ago

Proxy servers are set inside the guest as usual, not xhyve.

"xhyve" is a port of FreeBSD's "bhyve" to "OS X". "bhyve" is pronounced bee-hive, "xhyve" is pronounced eks-hive. 'x' like the letter, not 10 as in "OS X" ;)

ozbillwang commented 8 years ago

Thanks, @xez

I am pretty new for xhyve, how to set inside the guest? Do you mean I need update below xhyve.args file?

$ ps -ef |grep xhyve
  502 26940 26935   0  9:46am ??        36:19.12 /Applications/Docker.app/Contents/MacOS/com.docker.driver.amd64-linux -xhyve /Users/bill/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/xhyve.args

$ cat /Users/bill/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/xhyve.args

-A -m 4G -c 3 -u -s 0:0,hostbridge -s 31,lpc -s 2:0,virtio-ipc,uuid="d2175308-c48b-4f66-950b-50a8491b08ec",path="/var/tmp/com.docker.vmnetd.socket",macfile="/Users/bill/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/mac" -s 4,virtio-blk,'file:///Users/bill/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2' -s 5,virtio-9p,path="/tmp/fs.socket",tag=socket -s 6,virtio-9p,path=/var/tmp/com.docker.osxfs.socket,tag=fuse -s 7,virtio-9p,path="/var/tmp/com.docker.db.socket",tag=db -s 8,virtio-rnd -s 9,virtio-9p,path=/var/tmp/com.docker.slirp.port.socket,tag=port -l com1,pty="/Users/bill/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty",log="/Users/bill/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/console-ring" -f 'kexec,/Applications/Docker.app/Contents/Resources/moby/vmlinuz64,/Applications/Docker.app/Contents/Resources/moby/initrd.img,earlyprintk=serial console=ttyS0 virtio_pci.force_legacy=1 com.docker.driverDir="/Users/bill/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux", com.docker.database="com.docker.driver.amd64-linux"'
xez commented 8 years ago

No, proxy servers are set by whatever application inside the guest needs them. xhyve is a hypervisor, it runs a guest operating system, you would set a proxy server the same way as you would if you were running the same OS on a physical machine. Or I am confused what you mean by proxy server (Web, SOCKS ...)?

ozbillwang commented 8 years ago

Thanks for the explanation. I have set below in my shell environment, but seems the docker run command and docker containers in Native docker for mac don't read these environment.

http_proxy=http://proxy:3128
HTTPS_PROXY=http://proxy:3128
https_proxy=http://proxy:3128
HTTP_PROXY=http://proxy:3128

try to pull the image

$ docker pull busybox
Using default tag: latest
Pulling repository docker.io/library/busybox
Error while pulling image: Get https://index.docker.io/v1/repositories/library/busybox/images: dial tcp: lookup index.docker.io on 192.168.64.1:53: no such host
xez commented 8 years ago

Ah, ok. I think the Docker for Mac forum would be a better place to ask.

https://forums.docker.com/c/docker-for-mac

ozbillwang commented 8 years ago

Sure, raised the ticket already.