Live data from Hacker News

Simplifying Docker on OS X

blog.andyet.com

31–40 of 89 posts

Re: Simplifying Docker on OS X

#31
This looks great and is now high on my todo list to test.

I am all in on docker development because I am all in on using images and containers in production via ECS. Getting a laptop and AWS talking the same abstraction is the future.

I too suffer from problems with Docker Machine and virtual box on OS X. Frequently I find myself debugging these subsystems. It's been ok because the worst case to get back to a good state is uninstall, reboot and reinstall. Annoying but passable b

I have also experimented with xhyve and it looks extremely promising but does need some new tools to make it a turnkey docker dev environment.

From my survey of this technique and the tools we need more time, energy and cooperation to get there.

Thank you and everyone else for your efforts!

Re: Simplifying Docker on OS X

#32
Nice work joeyespo, it's definitely a much-needed step forward. NFS, though, is a huge pain point for me on OSX performance-wise. The only reliable solution I've found so far is Unison sync between Mac & Vagrant (Ubuntu). That also comes with some caveats, as Unison has to be compiled with exactly the same version & dependencies on both OSX and Ubuntu.

If anyone's interested, I've created a list of steps involved in making it work on El Capitan: https://gist.github.com/pch/aa1c9c4ec8522a11193b

Re: Simplifying Docker on OS X

#33
post #17

Earlier quoted context omitted.

Just use Vagrant! Start a Vagrant VM on your Mac and do the Docker stuff inside it.

If I "just used Vagrant," I think I'd end up with a virtualbox VM, just like if I were to have used docker-machine.

Vagrant is more repeatable, though. It's straightforward to provision an environment. In my (limited) experience with direct Virtualbox, you wind up manually building a lot of stuff.

Re: Simplifying Docker on OS X

#34

Thank you! I'll have to check this out. It baffles me that a company such as Docker has yet to make using its primary product on Mac OS X simple plug and play. Needing to remember to run `eval $(docker-machine env docker)` is not a sustainable solution. Hell I know about this and would occasionally forget and become confused at the error messages. In fact I put this horrible hack into my ~/.bash_profile (I wouldn't r…

From my understanding, the limitation is from OSX and not from Docker, as OSX does not have native support for kernel namespacing. This is why Docker on OSX runs inside of a Linux virtual machine.

Making OSX Linux is hard, but making Docker smarter about running on OSX is easy (have docker-machine provide a socket like this project does, have docker client detect the environment and connect to the correct virtual machine's docker socket) and would be an obvious huge step forward.

Re: Simplifying Docker on OS X

#35
post #5

I just use bash aliases in my .profile ---- alias dm="docker-machine" alias dc="docker-compose" alias denv='function __denv() { eval "$(dm env $@)"; unset -f __denv; }; __denv' ---- dm create --driver virtualbox local denv local Also works with swarm params: denv local --swarm swarm-master

Thanks for this, I'd been typing way too much for too long. However, dc overlaps with the dc program so I've moved to dkm and dkc (since I actually use dc from time to time.)

Re: Simplifying Docker on OS X

#36
Unfortunately it seems that Xhyve cannot connect to the Internet when traffic is routed through OpenVPN. Otherwise I would use it at my job. I tried https://github.com/coreos/coreos-xhyve, https://github.com/ailispaw/docker-root-xhyve and Veertu, and they all won't work.

Apparently is a known issue https://github.com/mist64/xhyve/issues/84 ; it might have to do with Hypervisor.framework

Re: Simplifying Docker on OS X

#37
post #16
post #4

Docker does run natively on OSX. Just forward a port with ssh/socat/etc and set the environment variable correctly to point to your build host that can run lxc. There is so much over-engineering going on in this arena. :/

There is no definition of "native" where your statement is true.

Containers don't run on osx, but docker isn't responsible for the containers anyway - lxc is.

The "docker" program builds and runs natively under osx just fine, like any other Go binary.

Re: Simplifying Docker on OS X

#38
post #36

Unfortunately it seems that Xhyve cannot connect to the Internet when traffic is routed through OpenVPN. Otherwise I would use it at my job. I tried https://github.com/coreos/coreos-xhyve , https://github.com/ailispaw/docker-root-xhyve and Veertu, and they all won't work. Apparently is a known issue https://github.com/mist64/xhyve/issues/84 ; it might have to do with Hypervisor.framework

Same goes for Cisco AnyConnect VPN. Updating the routing table seems to temporarily fix it, but it would be nice not to hack around it to get it to work.

Re: Simplifying Docker on OS X

#39
post #24

Pretty cool trick to make the OS X docker hacks feel transparent. I've been tempted into getting a Linux laptop just because using Docker on OS X feels so hacky.

If you're going to go through the trouble of having two computers anyway, why not make the second one a home Linux server? Point the docker client's socket at that machine, instead of at a VM. One of the benefits of doing this, I find, is that all the power-hungry stuff happens on the server, so I can have a really lightweight development machine (e.g. one of the 2015 Macbooks.)

...or just get one in a colo for $40/month.

Re: Simplifying Docker on OS X

#40
I feel like this isn't much simpler than the official docker-machine workflow, but I may be too far in the weeds at this point to objectively tell how complicated it is. In my case I need to test tools across 4 versions of Docker so I'm locked into using docker-machine and dvm.
Post reply on HN