Hacker News new | ask | show | jobs
by garadox 3711 days ago
If you want to run services in docker containers with Docker Toolbox (e.g. a mysql db), and you want the db stored on the Mac host, then you have to worry about 2 layers of folder mounts (one from host -> vm, one from vm -> container), another 2 layers of port forwarding (same as above), to make it 'feel' like your're running mysql locally.

With the beta, all of that is taken care for you with a couple of settings, and it's just much simpler to get up and running.

2 comments

Even boot2docker (docker machines predecessor) could do that. It shared the folders correctly and managed port forwarding. Of course localhost stop working but I just added the ip in /etc/hosts and enter docker.local instead (the docks say the IP might change but that's never happened to me).
> It shared the folders correctly

Except on Mac, where it sometimes doesn't. Have you not run into permissions issues? Or having a file-watcher process running in the container not being triggered by changes from the host? There are a tonne of quirks that came with boot2docker. It was worth it, of course, but they were still there; and this app is specifically aiming to address them.

That's still the case with docker for Mac. Swapping xhyve for virtualbox doesn't eliminate the port forwarding or device mounting.
Docker For Mac also does some other cool things, for instance exposed container ports are available at the address `docker.local`. Solutions to help deal with filesystem permission mis-matches, filesystem notifications, and VPN compatibility (all of which are things VirtualBox struggles with) are also being baked in.
It does in the latest update. Just run "pinata set native/port-forwarding true" and your docker containers will be accessible via localhost. Previously this only worked with the VPN compatibility mode, but it's available on its own now.

I also recommend running "pinata set network nat".