关于Docker,这是最详细的介绍

一、Docker是什么?

Docker is a platform that allows you to "build ,ship ,and run any  app, anywhere. "

Docker是一个平台,它提供哪些服务呢?任何一台装有Docker的机器上你都可以建立、发布、运行你的应用程序。

It has come a long way in an incredibly short time and is now considered a standard way of solving one of the costliest aspects of software: deployment.

Docker在很短的时间内就走得很远,如今它基本是解决软件最昂贵的环节:部署的标准解决方案。

在Docker出现之前,有一堆与软件部署的工具软件,虚拟机、配置管理工具、打包管理工具、复杂的webs库依赖。所有这些工具都需要专业的工程师去管理和维护,多数软件有一套独特的配置方法。

二、使用Docker有什么好处?

Some crucial practical questions arise: why would you use Docker, and for what? The short answer to the “why” is that for a modicum of effort, Docker can save your business a lot of money quickly. Some of these ways (and by no means all) are discussed in the following subsections. We’ve seen all of these benefits firsthand in real working contexts.

最关键的一句话:使用Docker可以省事、省时、省钱。

1、Docker can be used to replace VMs in many situations.

用来取代虚拟机;

2、Docker can give you a sandbox environment in milliseconds.

Docker可以在几毫秒内为您提供一个沙盒环境。

3、Because a Docker image has effectively no dependencies for a Linux user, it’s a great way to package software. You can build your image and be sure that it can run on any modern Linux machine—think Java, without the need for a JVM.

Docker是一个打包软件的好工具。将用java开发的软件打包成镜像后,就可以在任何一台Linux操作系统上运行,而不需要JVM(JAVA 虚拟机)。

4、Docker facilitates the decomposition of a complex system to a series of composable parts, which allows you to reason about your services in a more discrete way.

Docker有助于将一个复杂系统分解为一系列可组合的部分,这使您能够以一种更加离散的方式对服务进行推理。

5、Because you can spin up hundreds (even thousands) of isolated containers on one machine, modeling a network is a breeze. This can be great for testing real-world scenarios without breaking the bank.

Docker在一台机器上起成百上千个独立的容器,有助于模拟网络,使网络建模成为一件轻而易举的事情。

6、ENABLING FULL-STACK PRODUCTIVITY WHEN OFFLINE

Because you can bundle all the parts of your system into Docker containers, you can orchestrate these to run on your laptop and work on the move, even when offline.

由于你可以将所有系统打包进你的Docker容器,所以可以移动工作,甚至脱网离线工作。

7、REDUCING DEBUGGING OVERHEAD

减少调试开销

下面这段自己理解吧!

Complex negotiations between different teams about software delivered is a common- place within the industry. We’ve personally experienced countless discussions about bro- ken libraries; problematic dependencies; updates applied wrongly, or in the wrong order, or even not performed at all; unreproducible bugs; and so on. It’s likely you have too. Docker allows you to state clearly (even in script form) the steps for debugging a problem on a system with known properties, making bug and environment reproduction a much simpler affair, and one normally separated from the host environment provided.

8、Docker forces you to document your software dependencies explicitly from a base starting point.

Docker强迫你记录软件依赖,方便你其他地方布局或者安装软件。

9、ENABLING CONTINUOUS DELIVERY

实现持续交付

Continuous delivery (CD) is a paradigm for software delivery based on a pipeline that rebuilds the system on every change and then delivers to production (or “live”) through an automated (or partly automated) process.

Because you can control the build environment’s state more exactly, Docker builds are more reproducible and replicable than traditional software building methods. This makes implementing CD much easier. Standard CD techniques, such as Blue/Green deployment (where “live” and “last” deployments are maintained on live) and Phoenix deployment (where whole systems are rebuilt on each release), are made trivial by implementing a reproducible Docker-centric build process.

三、使用Docker来干什么?

比较一下Docker诞生前和诞生后软件开发的变化就能感受到Docker可以用来干嘛了。

Docker诞生是软件开发的新纪元

四、为什么要使用Docker?

docker:码头工人
使用和不使用docker对软件开发流程的影响

我们知道软件开发涉及开发阶段、测试阶段和版本发布阶段,在使用Docker之前这是隔离的三次工作,他们拥有不同的配置和环境,可是,有了Docker合3为1,世界变得美好多了。

五、Docker的核心概念

Docker的核心概念

容器:一个镜像的运行实例就是一个容器。


核心概念讲解


六、Docker的架构

Grasping Docker’s architecture is key to understanding Docker more fully.

熟悉Docker的结构是理解并使用好它的关键。Docker 使用客户端-服务器 (C/S) 架构模式,使用远程API来管理和创建Docker容器。Docker 容器通过 Docker 镜像来创建。容器与镜像的关系类似于面向对象编程中的对象与类。

Docker架构详解

The docker command is a client, and the Docker daemon acts as the server doing the processing on your Docker containers and images.

dockerClient 客户端

Docker Daemon 守护进程

Docker Image  镜像

DockerContainer  容器

七、安全使用Docker

Docker accessibility: normal and opened up

Docker的守护进程是可以对外网开放的,默认状态的设置是/var/run/docker.sock,外网无法连接,但是通过改变这一设置可以开放给其他人,比如你想让其他人帮你远程Debug或者开放给项目组成员,但是这样做是不安全的,一旦开放,所有可以联到你的主机的人都可以访问你本地Docker.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 218,546评论 6 507
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,224评论 3 395
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 164,911评论 0 354
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,737评论 1 294
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,753评论 6 392
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,598评论 1 305
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,338评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,249评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,696评论 1 314
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,888评论 3 336
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 40,013评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,731评论 5 346
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,348评论 3 330
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,929评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,048评论 1 270
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,203评论 3 370
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,960评论 2 355

推荐阅读更多精彩内容

  • 一、什么是docker Docker 是一个开源的应用容器引擎,基于 Go 语言 并遵从Apache2.0协议开源...
    林皮皮s阅读 1,326评论 0 5
  • Docker 是一个开源的应用容器引擎,基于Go 语言并遵从Apache2.0协议开源。 Docker 可以让开发...
    落羽成霜丶阅读 6,294评论 0 2
  • 那一天,我一个人走在深夜的街上,路灯把我的影子拉的老长。看着“影子”的大长腿,我似乎有些安慰:我腿不长,但我...
    BANK研究僧阅读 434评论 0 1
  • 周公梦蝶,是蝶入梦?亦或是周公身处梦境而不自知? 假如我们活在假时空,而真我存在于另一纬度中的乌托邦? 神奇的心墙...
    懒人小莹莹阅读 396评论 5 7
  • 杨庆丰自然成了顶重要的人物,教导主任问有没有写关于他的打油诗,其他年级的班主任也来套话看有没有编排他们,连给食堂做...
    温霄冰阅读 199评论 0 0