Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is docker a solution for making application cross platform?

I'm getting started with docker by reading some blogs and introduction material.

My understanding is docker can wrap a single application into a standardized container. The container provides a sandbox, all the necessary resources the application needs to run, and the application inside always live within that container. That means I can ship the container to everywhere( different kind of OS or even cloud platforms ) and it should still can be run correctly.

If my understanding is correct, then does that mean maybe microsoft can wrap their office suits into a container and I can install and run it on mac os or linux? And some other nice Mac application can also be shipped to windows and linux?

like image 842
Aaron Shen Avatar asked Jun 03 '15 23:06

Aaron Shen


People also ask

Does Docker work cross platform?

Docker has for some time supported multiplatform images where an image can have multiple different versions for different architectures and platforms. Pulling a multiplatform image will pull only the version for your current architecture.

What is Docker actually used for?

Docker is an open source containerization platform. It enables developers to package applications into containers—standardized executable components combining application source code with the operating system (OS) libraries and dependencies required to run that code in any environment.

Is Docker a framework or platform?

Docker, a subset of the Moby project, is a software framework for building, running, and managing containers on servers and the cloud.

What type of application is Docker?

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications.


1 Answers

Docker is a user-friendly layer on top of LXC, a set of Linux kernel features allowing namespacing of filesystem configuration, network resources, process tables, and other kernel-mediated resources which were historically global. (It's much closer to FreeBSD jails than it is to kvm or VMware).

These features are very specific to Linux, and an application running in a Docker container is still interfacing directly with the host's Linux kernel (though it only has access to the subset of resources exposed to the namespaces in which it participates). Similarly, opcodes are run directly on the hardware with no emulation on virtualization in place, so hardware differences are not abstracted away either

Docker is thus not a cross-OS (or cross-architecture) portability layer, and it will not successfully hide implementation details from applications which depend on specific kernel versions, much less entirely different operating systems altogether.


Early 2017 Update

Docker now runs on Mac, by bundling a lightweight virtualization stack very similar to kvm on Linux. When running this way, it's actually doing both virtualization and containerization -- the former to run a (single) Linux kernel, the latter to run a series of separate containers within this kernel.

This still means that it's limited to running native Linux apps, and it still doesn't provide a display layer for desktop applications (X11, VNC, or something else along those lines needs to be used in addition). However, by bundling a virtualization tool, modern Docker now is something of a portability solution (across platforms, not architectures).

like image 124
Charles Duffy Avatar answered Oct 21 '22 06:10

Charles Duffy