Docker是应用跨平台的解决方案吗? [英] Is docker a solution for making application cross platform?

查看:575
本文介绍了Docker是应用跨平台的解决方案吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过阅读一些博客和介绍资料开始了Docker。



我的理解是docker可以将单个应用程序包装到一个标准化的容器中。容器提供了一个沙盒,应用程序需要运行的所有必需资源,并且内部的应用程序始终位于该容器内。这意味着我可以将容器运送到任何地方(不同类型的操作系统甚至云平台),并且仍然可以正常运行。



如果我的理解正确,那么这是否意味着微软可以将其办公套装包装到一个容器中,我可以在mac os或linux上安装和运行它?还有一些其他漂亮的Mac应用程序也可以发送到windows和linux?

解决方案

Docker是一个用户友好的层LXC是一组Linux内核功能,允许命名为文件系统配置,网络资源,进程表以及历史上全球的内核介质资源。 (它比FreeBSD监狱更接近于kvm或VMware)。



这些功能非常具体到Linux,而在Docker容器中运行的应用程序仍然是连接直接与主机的Linux内核(尽管它只能访问暴露于其参与的命名空间的资源的子集)。类似地,操作码直接在硬件上运行,没有对虚拟化进行仿真,所以硬件差异不会被抽象出来。



Docker因此跨操作系统(或跨架构)可移植性层,并且不会成功地从依赖于特定内核版本的应用程序隐藏实现细节,完全不同于完全不同的操作系统。






2017年初更新



Docker现在在Mac上运行,通过捆绑与kvm非常相似的轻量级虚拟化堆栈Linux操作系统。当运行这种方式时,它实际上是在虚拟化和容器化两个方面 - 前者运行一个(单一的)Linux内核,后者在这个内核中运行一系列单独的容器。



这仍然意味着它仅限于运行本机Linux应用程序,并且仍然不提供桌面应用程序的显示层(X11,VNC或者需要使用这些行的其他内容)此外)。然而,通过捆绑虚拟化工具,现代Docker现在是可移植性解决方案(跨平台,而不是架构)。


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?

解决方案

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).

这篇关于Docker是应用跨平台的解决方案吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆