Docker GitHub 网站中 Readme.md 以技术者的角度翻译
Docker 是一个开源的轻量级容器项目,用于让你的应用在它上面打包、集装和运行。
Docker 运行的环境既包含未知硬件也包含未知操作系统。这句话的意思是它可以运行在任何地方,小到你的笔记本大到一个大型的云计算实体,除此之外也不需要你掌握或用到任何特定的开发语言、框架或者打包系统。这使得他们能够在不依赖任何特定堆栈或者提供者的情况下部署可扩展的web应用程序、数据库或者后台服务。
Docker 的前身是dotCloud旗下的一款开源的部署引擎的实现,一款很受欢迎接口服务平台。它成功直接收益于积累了多年的大规模操作和支持数十万应用程序和数据库
安全披露
安全对我们来说是非常重要的。如果你遇到任何问题涉及到安全,请负责任的披露这些信息到邮箱:security@docker.com,请不要在GitHub创建问题。
比虚拟机更强
一个共同的方法是用虚拟机去构建应用程序和沙箱环境去运行验证。典型的虚拟机格式是VMware的VMDK,Oracle VirtualBox的VDI,和亚马逊的EC2 AMI。从理论上讲,这些格式需要允许每一个开发者将他们的应用程序自动打包成一个“machine”,以便分发和部署;实际情况是,有一些因数让这几乎不会实现:
1、大小:VMs非常大,这使得它无法方便存储和传输。
2、性能:运行VMs会消耗大量的CPU和内存,这使得它在一些情况下变得不切实际,例如本地部署大量机器来开发多层应用程序或大规模部署CPU和内存密集型应用程序。
3、可移植性:处于竞争关系的VM环境不会很好的兼容彼此。即使转换工具存在,他们也会收到一些限制,并且会增加额外开销。
4、硬件中心:VMs设计之初更多的考虑操作系统层面,并不是软件开发层面。因此,他们提供了极少的、用于创建、测试、运行开发软件的工具给开发人员。举个例子,VMs 没有提供设施和工具用于应用程序版本控制,监控、配置、日志和服务发现。
通过对比,Docker通过依赖不同的沙箱方法来实现集装箱。不像传统的虚拟化,集装箱在内核级运行,大多数现代操作系统内核现在支持必要的集装箱的原语,这些操作系统包括Linux 的 openvz,vserver 和最近的 lxc,Solaris 的 zones,和 FreeBSD的jails.
Docker基于这些低级原语为开发人员提供了一个便携式的格式和运行环境,解决了四个问题。而且Docker容器很小(他们的传输可以在层级间优化),它在内存和CPU上的开销几乎为0,它是完全便携式,并且基于应用程序为中心的设计。
或许它是最好的,因为Docker运行在操作系统层,它也可以运行在VM中!
和其他玩的很好
Docker不要求你购买到一个特定的编程语言,框架,包装系统,或配置语言。
是一个UNIX进程申请的?它使用文件、TCP连接、环境变量、标准UNIX流和命令行参数作为输入和输出?然后Docker可以运行它。
您的应用程序的构建可以被表示为这样的命令序列吗?然后Docker可以建造它。
从依赖的地狱中逃脱
一个常见的问题是开发人员很难在一个简单而自动化的方式下管理他们的应用程序的依赖关系。
通常情况下这些困难是由一下几方面原因导致的:
1、跨平台依赖。现代应用程序通常依赖于一个组合的系统库和二进制文件,特定的语言包,框架的具体模块,内部组件开发也开发过另一个项目等。这些依赖关系,存活在不同的“世界”,需要不同的工具,这些工具通常相互配合不是很好,需要尴尬的定制集成。
2、相互依赖。不同的应用程序可能依赖于同一依赖的不同版本。包装工具处理这些情况有不同程度的缓解-但他们都处理他们在不同的和不兼容的方式,这又迫使开发人员做额外的工作。
3、自定义依赖项。开发人员可能需要准备一个自定义版本的应用程序的依赖。一些包装系统可以处理自定义版本的依赖,其他都不能做,并且他所有处理的自定义版本依赖也很困难。
Docker给开发者一个简单的方法来在一个地方表达自己所有的应用程序的依赖关系解决相依性地狱的问题,同时简化组装过程。如果这让你觉得XKCD 927,别担心。Docker不会取代你最喜欢的包装系统。它只是协调他们的使用在一个简单的和可重复的方式。它是怎么做到的?在层级间吗。
Docker定义建立运行一系列的UNIX命令,一前一后,在同一个容器。生成命令修改容器的内容(通常是在文件系统上安装新文件),下一个命令会对它进行一些修改,等等。因为每个生成命令继承了以前命令的结果,命令执行的顺序表示依赖关系。
下面是一个典型的Docker建立过程:
FROM ubuntu:12.04
RUN apt-get update && apt-get install -y python python-pip curl
RUN curl -sSL https://github.com/shykes/helloflask/archive/master.tar.gz | tar -xzv
RUN cd helloflask-master && pip install -r requirements.txt
注意,Docker不关心依赖是怎么建立的-只要他们建造可以运行在容器中的UNIX命令。
原文
Docker is an open source project to pack, ship and run any application as a lightweight container.
Docker containers are both hardware-agnostic and platform-agnostic. This means they can run anywhere, from your laptop to the largest cloud compute instance and everything in between - and they don't require you to use a particular language, framework or packaging system. That makes them great building blocks for deploying and scaling web apps, databases, and backend services without depending on a particular stack or provider.
Docker began as an open-source implementation of the deployment engine which powered dotCloud, a popular Platform-as-a-Service. It benefits directly from the experience accumulated over several years of large-scale operation and support of hundreds of thousands of applications and databases.
Security Disclosure
Security is very important to us. If you have any issue regarding security, please disclose the information responsibly by sending an email to security@docker.com and not by creating a GitHub issue.
Better than VMs
A common method for distributing applications and sandboxing their execution is to use virtual machines, or VMs. Typical VM formats are VMware's vmdk, Oracle VirtualBox's vdi, and Amazon EC2's ami. In theory these formats should allow every developer to automatically package their application into a "machine" for easy distribution and deployment. In practice, that almost never happens, for a few reasons:
- Size: VMs are very large which makes them impractical to store and transfer.
- Performance: running VMs consumes significant CPU and memory, which makes them impractical in many scenarios, for example local development of multi-tier applications, and large-scale deployment of cpu and memory-intensive applications on large numbers of machines.
- Portability: competing VM environments don't play well with each other. Although conversion tools do exist, they are limited and add even more overhead.
- Hardware-centric: VMs were designed with machine operators in mind, not software developers. As a result, they offer very limited tooling for what developers need most: building, testing and running their software. For example, VMs offer no facilities for application versioning, monitoring, configuration, logging or service discovery.
By contrast, Docker relies on a different sandboxing method known as containerization. Unlike traditional virtualization, containerization takes place at the kernel level. Most modern operating system kernels now support the primitives necessary for containerization, including Linux with openvz, vserver and more recently lxc, Solaris with zones, and FreeBSD with Jails.
Docker builds on top of these low-level primitives to offer developers a portable format and runtime environment that solves all four problems. Docker containers are small (and their transfer can be optimized with layers), they have basically zero memory and cpu overhead, they are completely portable, and are designed from the ground up with an application-centric design.
Perhaps best of all, because Docker operates at the OS level, it can still be run inside a VM!
Plays well with others
Docker does not require you to buy into a particular programming language, framework, packaging system, or configuration language.
Is your application a Unix process? Does it use files, tcp connections, environment variables, standard Unix streams and command-line arguments as inputs and outputs? Then Docker can run it.
Can your application's build be expressed as a sequence of such commands? Then Docker can build it.
Escape dependency hell
A common problem for developers is the difficulty of managing all their application's dependencies in a simple and automated way.
This is usually difficult for several reasons:
Cross-platform dependencies. Modern applications often depend on a combination of system libraries and binaries, language-specific packages, framework-specific modules, internal components developed for another project, etc. These dependencies live in different "worlds" and require different tools - these tools typically don't work well with each other, requiring awkward custom integrations.
Conflicting dependencies. Different applications may depend on different versions of the same dependency. Packaging tools handle these situations with various degrees of ease - but they all handle them in different and incompatible ways, which again forces the developer to do extra work.
Custom dependencies. A developer may need to prepare a custom version of their application's dependency. Some packaging systems can handle custom versions of a dependency, others can't - and all of them handle it differently.
Docker solves the problem of dependency hell by giving the developer a simple way to express all their application's dependencies in one place, while streamlining the process of assembling them. If this makes you think of XKCD 927, don't worry. Docker doesn't replace your favorite packaging systems. It simply orchestrates their use in a simple and repeatable way. How does it do that? With layers.
Docker defines a build as running a sequence of Unix commands, one after the other, in the same container. Build commands modify the contents of the container (usually by installing new files on the filesystem), the next command modifies it some more, etc. Since each build command inherits the result of the previous commands, the order in which the commands are executed expresses dependencies.
Here's a typical Docker build process:
FROM ubuntu:12.04
RUN apt-get update && apt-get install -y python python-pip curl
RUN curl -sSL https://github.com/shykes/helloflask/archive/master.tar.gz | tar -xzv
RUN cd helloflask-master && pip install -r requirements.txt
Note that Docker doesn't care how dependencies are built - as long as they can be built by running a Unix command in a container.
Docker GitHub 网站中 Readme.md 以技术者的角度翻译的更多相关文章
- 原来Github上的README.md文件这么有意思——Markdown语言详解
转载请注明出处:http://blog.csdn.net/zhaokaiqiang1992 之前一直在使用github,也在上面分享了不少的项目和Demo,每次创建新项目的时候,使用的都是默认的REA ...
- 【转录】原来Github上的README.md文件这么有意思——Markdown语言详解
之前一直在使用github,也在上面分享了不少的项目和Demo,每次创建新项目的时候,使用的都是默认的README.md文件,也不曾对这个文件有过什么了解.但是在看到别人写的项目的README.md里 ...
- 原来Github上的README.md文件这么有意思——Markdown语言详解(sublime text2 版本)
一直想学习 Markdown 语言,想起以前读的一篇 赵凯强 的 博客 <原来Github上的README.md文件这么有意思——Markdown语言详解>,该篇博主 使用的是Mac系统, ...
- GitHub中README.md文件的编辑和使用
最近对它的README.md文件颇为感兴趣.便写下这贴,帮助更多的还不会编写README文件的同学们. README文件后缀名为md.md是markdown的缩写,markdown是一种编辑博客的语言 ...
- 【GitHub】给GitHub上的ReadMe.md文件中添加图片怎么做 、 gitHub创建文件夹
1.首先在github上的仓库上,创建一个空的文件夹,用于上传图片 上图看 要点击的按钮是创建新的文件,并不是创建新的文件夹,具体怎么?往下看 这个时候,下面的提交按钮才能提交 2.进入新创建的文件夹 ...
- github里的readme.md
在github里如何写readme.md https://www.cnblogs.com/guchunli/p/6371040.html----------------------> READM ...
- GitHub webstorm 及 README.md 姿势
README.md 语法格式: 规范的README文件开头都写上一个标题,这被称为大标题. 标题: #一级标题 ##二级标题 ###三级标题 ####四级标题 #####五级标题 ######六级标题 ...
- 在GitHub上编辑README.md排版样式
如何在github的readme.md编辑出好看的样式排版文章呢...? 参考:https://blog.csdn.net/u012067966/article/details/50736647
- 42 github 开源代码 ——README.md语法/相关操作等
0 引言 最近在github上开源了pro/E二次开发的代码,发现README.md的编辑方式很有趣,需要稍微了解一下. 1 markdown语法 参考了两篇博客的内容,链接如下. https://b ...
随机推荐
- PHP的数据加密解密
本文出至:新太潮流网络博客 /** * [对数据进行加密] * @E-mial wuliqiang_aa@163.com * @TIME 2017-04-07 * @WEB http://blog.i ...
- 网工最实用最常用的网络命令之一——Ping 命令详解(一)
Ping是Windows.Unix和Linux系统下的一个命令.ping也属于一个通信协议,是TCP/IP协议的一部分.利用“ping”命令可以检查网络是否连通,可以很好地帮助我们分析和判定网络故障. ...
- mysql数据导入导出与数据表优化
一.数据导入 mysqlimport -uroot oa d:/aa.txt --fields-terminated-by=, --fields-optionally-enclosed-by= --l ...
- SDN 第四次作业
阅读 了解SDN控制器的发展 http://www.sdnlab.com/13306.html http://www.docin.com/p-1536626509.html 了解ryu控制器 http ...
- EF CodeFirst 数据库的操作
生成数据库 首先需要通过Nuget安装Migration 这一步是初始化Migration操作. 首先打开程序包控制台, 工具——NuGet包管理器——程序包管理控制台 打开后,在控制台输入下面的命令 ...
- Java之时间转换
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = sdf.parse( ...
- 【转】numpy中mean和average的区别
转自:https://blog.csdn.net/Muzi_Water/article/details/85104941 mean和average都是计算均值的函数,在不指定权重的时候average和 ...
- scrapy shell
一.scrapy shell 1.安装pip install Jupyter 2.在pycharm中的启动命令: scrapy shell 注:启动后关键字高亮显示 3.查看response 执行sc ...
- Python 函数(二)
Python 3 函数(匿名函数.偏函数 and 变量作用域:全局变量.局部变量) 一.匿名函数:没有名字,也不再使用 def 语句这样标准的形式定义的一个函数. OCP培训说明连接:https:// ...
- Vim2.1-Vim简明教程【CoolShell】【非原创】
vim的学习曲线相当的大(参看各种文本编辑器的学习曲线),所以,如果你一开始看到的是一大堆VIM的命令分类,你一定会对这个编辑器失去兴趣的.下面的文章翻译自<Learn Vim Progress ...