8

I am using Docker CE v18.06.0-ce-mac70 (26399). Does it still need VirtualBox to run containers? Would Docker still run if I uninstall my VirtualBox?

enter image description here

7

Good question. Seems confusing based on the documentation which states:

Docker for Mac uses HyperKit, a lightweight macOS virtualization solution built on top of the Hypervisor.framework.

But then states:

Currently, there is no docker-machine create driver for HyperKit, so use the virtualbox driver to create local machines. (See the Docker Machine driver for Oracle VirtualBox.) You can run both HyperKit and Oracle VirtualBox on the same system. To learn more, see Docker for Mac vs. Docker Toolbox.

So it seems like if you are not concerned about docker-machine create then you can use Docker CE without VirtualBox installed. But if you ask me, it seems that at some point you might get snagged while playing around with containers, so the best bet is to keep VirtualBox installed.

My personal best advice is if you don’t want VirtualBox around, just ditch it for now and do as you wish with Docker CE. And if/when you hit some command wall—such as the docker-machine create item mentioned above—then just install VirtualBox and accept that as the “price of admission” for using Docker on macOS.

2

Here's a quick update on the issue: According to the official documentation on https://docs.docker.com/docker-for-mac/docker-toolbox/:

Docker Desktop for Mac uses HyperKit instead of Virtual Box. Hyperkit is a lightweight macOS virtualization solution built on top of Hypervisor.framework in macOS 10.10 Yosemite and higher.

It comes with a major limitation though:

Also note that Docker Desktop for Mac can’t route traffic to containers, so you can’t directly access an exposed port on a running container from the hosting machine.

If you do need multiple VMs, such as when testing multi-node swarms, you can continue to use Docker Machine, which operates outside the scope of Docker Desktop for Mac. See Docker Toolbox and Docker Desktop for Mac coexistence.

So while Hyperkit is the closest thing to native virtualisation on macOS and might cause less overhead than VirtualBox based docker environments, it also lacks the capabilities to expose your containers on the network.

Personally, I don't think this is a huge deal since few people run mac based servers and when they do, a graphical user interface shouldn't be the show stopper. Docker Toolbox still uses Virtualbox and will provide a command line interface to run whatever you need on the network.

3
  • I think the last line Personally, I don't think this is a huge deal since no one really runs mac based servers. got you downvoted – hanxue Aug 18 '19 at 5:40
  • 2
    That's fine. I don't care as long as it helps the OP. It's funny though how people on the internet will punish you for their personal butthurt. – Michael Aug 19 '19 at 11:14
  • 1
    Yeah, agreed. Just so you know, I would not downvote any answers just because I disagree with it. Only downvote misleading or wrong information. Also mods in some StackExchange sites get overzealous and close questions that are slightly vague, even though there are good ones. I wish people are kinder to each other, but oh well – hanxue Aug 19 '19 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.