Live data from Hacker News

Simplifying Docker on OS X

blog.andyet.com

1–10 of 89 posts

Re: Simplifying Docker on OS X

#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. :/

Re: Simplifying Docker on OS X

#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

Re: Simplifying Docker on OS X

#6
Add this to your bash profile and it will feel simpler

function docker_activate() { eval $(docker-machine env $1) }

alias docker_activate=docker_activate

Then:

docker-machine start mymachine

docker_activate mymachine

Re: Simplifying Docker on OS X

#9

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.

Would it not just be easier to dual boot Linux? If you've got a big enough hard drive it works very nicely.

Re: Simplifying Docker on OS X

#10
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 recommend doing this but, hey, it works.):

docker-machine start dev

eval "$(docker-machine env dev)"

Post reply on HN