书籍详情

第一本Docker书

第一本Docker书

作者:(澳)James Turnbull 著; 李兆海,刘斌,巨震 译

出版社:人民邮电出版社

出版时间:2014-12-01

ISBN:9787115377333

定价:¥59.00

购买这本书可以去
内容简介
  本书由Docker 公司前服务与支持副总裁James Turnbull 编写,是权威的Docker 开发指南。本书会指导读者完成Docker 的安装、部署、管理和扩展,带领读者经历从测试到生产的整个开发生命周期,让读者了解Docker 适用于什么场景。书中先介绍Docker 及其组件的基础知识,然后用Docker 构建容器和服务来完成各种任务:利用Docker 为新项目建立测试环境,演示如何使用持续集成的工作流集成Docker,如何构建应用程序服务和平台,如何使用Docker 的API,如何扩展Docker。本书适合对Docker 或容器开发感兴趣的系统管理员、运维人员和开发人员阅读。
作者简介
  作者简介James Turnbull是一位技术作家,还是一名开源极客。他最近的大作是一本讲述流行开源日志工具的书——The LogStash Book。James还写了两本关于Puppet的书,一本是Pro Puppet以,另一本是较早的Pulling Strings with Puppet: Configuration Management Made Easy。此外,James还写了Pro Linux System Administration、Pro Nagios 2.0和Hardening Linux这三本书。James真正的工作是Kickstarter的工程副总裁。之前,James曾担任Docker公司服务与支持副总裁、Venmo公司工程副总裁和Puppet Labs的技术运维副总裁。James热爱美食、美酒、阅读、摄影,还很喜欢猫咪,但对在海滩上手牵手散步却并不热衷。译者简介李兆海 网名Googol Lee。使用Googol这个名字真的是因为“10的100次方”这个意思,和后来的Google公司没有一点儿关系。多年后端程序员,早期以C、C++为主,后来转向Python,现在以Go为生。曾写过《Golang初探》发表于2011年2月号《程序员》。Docker早期使用者。平时喜欢乱翻书,遇到感兴趣的都会研究一番。Twitter账户@googollee。刘斌 具有10余年软件开发经验,关注后台开发技术和各种编程语言。做过电子商务、金融、企业系统以及Android手机开发;写过Delphi,也兼做系统管理员和DBA(现在都改叫DevOps了);既做后台应用,也要调用前台CSS和JavaScript,可还是不敢自称Full Stack;今又舶来Growth Hacker,我想我要做一个Growth Engineer。巨震 北京大学软件工程硕士,服务器端开发者。目前就职于创业公司,使用Node.js、Golang进行服务器端开发。2013年底开始研究Docker,是Docker中文社区的活跃贡献者,负责Docker技术文章和视频的翻译、校对工作。生活中喜欢美食、骑行,热衷于PC硬件,喜爱折腾,热爱一切计算机相关的技术,坚信技术改变世界。最崇拜的技术传奇人物是前id Software首席程序员、现Oculus VR首席技术官John Carmack。
目录
目录
第1 章 简介····································1 1.1 Docker 简介·····························2 1.1.1 提供一个简单、轻量的建模方式·························2 1.1.2 职责的逻辑分离················3 1.1.3 快速、高效的开发生命周期··3 1.1.4 鼓励使用面向服务的架构·····3 1.2 Docker 组件·····························3 1.2.1 Docker 客户端和服务器·······4 1.2.2 Docker 镜像······················4 1.2.3 Registry ···························5 1.2.4 容器·······························5 1.3 我们能用Docker 做什么·············6 1.4 Docker 与配置管理····················7 1.5 Docker 的技术组件····················8 1.6 本书的内容·····························9 1.7 Docker 资源··························· 10 第2 章 安装Docker ······················· 11 2.1 安装Docker 的先决条件··········· 12 2.2 在Ubuntu 中安装Docker ·········· 13 2.2.1 检查前提条件················· 14 2.2.2 安装Docker ···················· 16 2.2.3 Docker 与UFW ··············· 17 2.3 在Red Hat 和Red Hat 系发行版中安装Docker ···························17 2.3.1 检查前提条件················· 18 2.3.2 安装Docker···················· 19 2.3.3 在Red Hat 系发行版中启动Docker 守护进程·············· 20 2.4 在OS X 中安装Boot2Docker ····· 21 2.4.1 在OS X 中安装Boot2Docker ··················· 21 2.4.2 在OS X 中启动Boot2Docker ··················· 22 2.4.3 测试Boot2Docker ············ 23 2.5 在Windows 中安装Boot2Docker 23 2.5.1 在Windows 中安装Boot2Docker ··················· 23 2.5.2 在Windows 中启动Boot2Docker ··················· 24 2.5.3 测试Boot2Docker ············ 25 2.6 使用本书的Boot2Docker 示例···· 25 2.7 Docker 安装脚本····················· 26 2.8 二进制安装··························· 27 2.9 Docker 守护进程····················· 28 2.9.1 配置Docker 守护进程······· 28 2.9.2 检查Docker 守护进程是否正在运行······················· 30 2.10 升级Docker ························· 31 2.11 Docker 图形用户界面············· 31 2.12 小结··································· 32 第3 章 Docker 入门······················ 33 3.1 确保Docker 已经就绪·············· 33 3.2 运行我们的第一个容器············ 34 3.3 使用第一个容器····················· 36 3.4 容器命名······························ 38 3.5 重新启动已经停止的容器·········· 39 3.6 附着到容器上························ 39 3.7 创建守护式容器····················· 40 3.8 容器内部都在干些什么············ 41 3.9 查看容器内的进程·················· 42 3.10 在容器内部运行进程·············· 43 3.11 停止守护式容器···················· 44 3.12 自动重启容器······················· 44 3.13 深入容器····························· 45 3.14 删除容器····························· 46 3.15 小结··································· 47 第4 章 使用Docker 镜像和仓库······· 49 4.1 什么是Docker 镜像················· 49 4.2 列出镜像······························ 51 4.3 拉取镜像······························ 54 4.4 查找镜像······························ 56 4.5 构建镜像······························ 57 4.5.1 创建Docker Hub 账号······· 58 4.5.2 用Docker 的commit 命令创建镜像······················· 59 4.5.3 用Dockerfile构建镜像······················· 61 4.5.4 基于Dockerfile构建新镜像····················· 64 4.5.5 指令失败时会怎样············ 66 4.5.6 Dockerfile 和构建缓存·· 67 4.5.7 基于构建缓存的Dockerfile模板····························· 67 4.5.8 查看新镜像···················· 68 4.5.9 从新镜像启动容器··········· 69 4.5.10 Dockerfile 指令········· 72 4.6 将镜像推送到Docker Hub········· 83 4.7 删除镜像······························ 88 4.8 运行自己的Docker Registry······· 90 4.8.1 从容器运行Registry ········· 90 4.8.2 测试新Registry ··············· 91 4.9 其他可选Registry 服务············· 92 4.10 小结··································· 92 第5 章 在测试中使用Docker··········· 93 5.1 使用Docker 测试静态网站········ 93 5.1.1 Sample 网站的初始Dockerfile ················· 94 5.1.2 构建Sample 网站和Nginx镜像····························· 96 5.1.3 从Sample 网站和Nginx 镜像构建容器······················· 97 5.1.4 修改网站······················ 100 5.2 使用Docker 构建并测试Web应用程序·············································· 101 5.2.1 构建Sinatra 应用程序······ 101 5.2.2 创建Sinatra 容器············ 102 5.2.3 构建Redis 镜像和容器····· 104 5.2.4 连接到Redis 容器··········· 106 5.2.5 连接Redis····················· 108 5.2.6 让Docker 容器互连········· 110 5.2.7 使用容器连接来通信······· 114 5.3 Docker 用于持续集成·············· 116 5.3.1 构建Jenkins 和Docker服务器························· 117 5.3.2 创建新的Jenkins 作业······121 5.3.3 运行Jenkins 作业············124 5.3.4 与Jenkins 作业有关的下一步·························126 5.3.5 Jenkins 设置小结·············126 5.4 多配置的Jenkins····················126 5.4.1 创建多配置作业·············126 5.4.2 测试多配置作业·············130 5.4.3 Jenkins 多配置作业小结····132 5.5 其他选择·····························132 5.5.1 Drone ···························132 5.5.2 Shippable ······················132 5.6 小结···································132 第6 章 使用Docker 构建服务·········133 6.1 构建第一个应用····················133 6.1.1 Jekyll 基础镜像···············134 6.1.2 构建Jekyll 基础镜像········135 6.1.3 Apache 镜像···················135 6.1.4 构建Jekylll Apache 镜像···136 6.1.5 启动Jekylll 网站·············137 6.1.6 更新Jekyll 网站··············140 6.1.7 备份Jekyll 卷·················141 6.1.8 扩展Jekyll 示例网站········142 6.2 使用Docker 构建一个Java应用服务·····························143 6.2.1 WAR 文件的获取器·········143 6.2.2 获取WAR 文件··············144 6.2.3 Tomecat7 应用服务器·······145 6.2.4 运行WAR 文件··············146 6.2.5 基于Tomcat 应用服务器的构建服务······················147 6.3 多容器的应用栈····················150 6.3.1 Node.js 镜像··················150 6.3.2 Redis 基础镜像··············· 153 6.3.3 Redis 主镜像·················· 154 6.3.4 Redis 从镜像·················· 155 6.3.5 创建Redis 后端集群········ 156 6.3.6 创建Node 容器·············· 160 6.3.7 捕获应用日志················ 161 6.3.8 Node 程序栈的小结········· 164 6.4 不使用SSH 管理Docker 容器··· 164 6.5 小结··································· 166 第7 章 使用Fig 编配Docker·········· 167 7.1 Fig ····································· 168 7.1.1 安装Fig ······················· 168 7.1.2 获取示例应用················ 169 7.1.3 fig.yml 文件··············· 172 7.1.4 运行Fig ······················· 173 7.1.5 使用Fig ······················· 175 7.1.6 Fig 小结······················· 178 7.2 Consul、服务发现和Docker ····· 178 7.2.1 构建Consul 镜像············ 179 7.2.2 在本地测试Consul 容器··· 182 7.2.3 使用Docker 运行Consul集群···························· 184 7.2.4 启动具有自启动功能的Consul 节点··················· 186 7.2.5 启动其余节点················ 188 7.2.6 配合Consul,在Docker里运行一个分布式服务···· 193 7.3 其他编配工具和组件·············· 201 7.3.1 Fleet 和etcd··················· 202 7.3.2 Kubernetes····················· 202 7.3.3 Apache Mesos················· 202 7.3.4 Helios ·························· 202 7.3.5 Centurion ······················ 203 7.3.6 Libswarm ······················203 7.4 小结···································203 第8 章 使用Docker API ················205 8.1 Docker API ···························205 8.2 初识Remote API····················206 8.3 测试Docker Remote API ··········207 8.3.1 通过API 来管理Docker镜像····························208 8.3.2 通过API 管理Docker容器····························211 8.4 改进TProv 应用····················213 8.5 对Docker Remote API 进行认证··217 8.5.1 建立证书授权中心···········218 8.5.2 创建服务器的证书签名请求和密钥·························220 8.5.3 配置Docker 守护进程······222 8.5.4 创建客户端证书和秘钥·····223 8.5.5 配置Docker 客户端开启认证功能······················224 8.6 小结···································226 第9 章 获得帮助和对Docker进行改进··························· 227 9.1 获得帮助····························· 227 9.1.1 Docker 用户和开发邮件列表······················ 228 9.1.2 IRC 上的Docker ············· 228 9.1.3 GitHub 上的Docker ········· 228 9.2 报告Docker 的问题················ 229 9.3 搭建构建环境······················· 229 9.3.1 安装Docker··················· 229 9.3.2 安装源代码和构建工具···· 229 9.3.3 检出源代码··················· 230 9.3.4 贡献文档······················ 230 9.3.5 构建开发环境················ 231 9.3.6 运行测试······················ 232 9.3.7 在开发环境中使用Docker··· 233 9.3.8 发起pull request ············· 234 9.3.9 批准合并和维护者·········· 236 9.4 小结··································· 236
猜您喜欢

读书导航