Docker Desktop vs Linux Virtual machine running Docker in production

Hi,

I remember reading (not sure where) that docker Desktop (for Mac and maybe Windows) is not suitable for production environments.

If I wanted to keep using Mac as a production server, would it be better to use Docker Desktop or should I install a virtual machine, running (for example) ubuntu + docker engine. This second option I guess should be supported as long it is running on a supported OS, independently where the VM is running (Linux or Mac).

I would also like to know the difference (in performance) among Docker desktop running natively on Mac or running inside a VM. I did a few tests and the performance is quite similar, although a little bit worse in Desktop.

Thanks!

Docker does not run natively on a Mac. Docker Desktop runs a virtual machine in which docker is hosted. This is why you don’t see any real difference in running your own virtual machine vs the Docker Desktop virtual machine. They are pretty much the same stack.

I would run your own Linux VM with Docker engine installed on it. That will give you the greatest control.

I’m going to recommend the opposite of what John recommends.

If you’re going for performance and you have to use a Mac host OS, I’d recommend Docker Desktop. A full Linux VM on top of Mac OS can be pretty fat with all of it’s extra processes. I would assume that the Docker Desktop is as slim and as optimized as possible so the performance would be much better. True, you can slim down a Linux install to be as minimal as possible, but then you’re basically just recreating Docker Desktop. Why not use the real thing? (I do however need to mention, Docker Desktop is still a virtual machine and not as good as running a configuration without any virtualization at all.)

Not only that, but the startup time and maintenance is going to be a lot less for a Docker Desktop vs a full blown Linux VM install with Docker on top of it. With a Linux VM, you have to maintain Mac OS, maintain Docker and maintain Linux. If you use Docker Desktop, the maintenance of the Linux part is kinda already taken care of for you.

Having said that, Docker is really a Linux program. So, if your want the most flexibility and the best support and the best features and the best reliability and best performance, you should actually run Docker on a bare-metal Linux server with Docker installed. This configuration completely removes the virtualization for the best performance.

Having said that, I don’t see why Docker Desktop couldn’t be used on Mac for production systems. You just have to weigh the pros and cons of doing it that way.

If you’re getting better performance with Docker in a VM on your Mac vs Docker Desktop, well that’s very surprising. True they’re both VM’s but I would think that Docker Desktop would be better optimized than a full blown VM. But at the end of the day, real world performance tests are king. I’m only talking about theory. If Docker Desktop is actually slower, maybe there’s a bug in it and you should report it.