没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Version: v1.0.7 (8f1618c) 1
Contents
Page
List of Figures viii
List of Listings xix
Foreword 1
Who is this book for? ................................ 1
Credits and Acknowledgments .......................... 1
Technical Reviewers ............................... 2
Scott Collier .................................. 2
John Ferlito ................................... 2
Paul Nasrat ................................... 3
Technical Illustrator ................................ 3
Proofreader ..................................... 3
Author ........................................ 4
Conventions in the book ............................. 4
Code and Examples ................................ 4
Colophon ...................................... 5
Errata ........................................ 5
Version ....................................... 5
Copyright ...................................... 5
Chapter 1 Introduction 7
Introducing Docker ................................ 8
An easy and lightweight way to model reality .............. 9
A logical segregation of duties ....................... 9
Fast, ecient development life cycle ................... 9
i
Contents
Docker components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Docker client and server . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Docker images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Registries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
What can you use Docker for? . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Docker with conguration management . . . . . . . . . . . . . . . . . . . 14
Docker's technical components . . . . . . . . . . . . . . . . . . . . . . . . . 16
What's in the book? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Docker resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Chapter 2 Installing Docker 19
Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Installing on Ubuntu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Checking for prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Installing Docker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Docker and UFW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Installing on Red Hat and family . . . . . . . . . . . . . . . . . . . . . . . . 26
Checking for prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Installing Docker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Starting the Docker daemon on the Red Hat family . . . . . . . . . . . 29
Boot2Docker installation on OS X . . . . . . . . . . . . . . . . . . . . . . . 30
Installing Boot2Docker on OSX . . . . . . . . . . . . . . . . . . . . . . . . 31
Setting up Boot2Docker on OSX . . . . . . . . . . . . . . . . . . . . . . 32
Testing Boot2Docker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Boot2Docker installation on Windows . . . . . . . . . . . . . . . . . . . . . 33
Installing Boot2Docker on Windows . . . . . . . . . . . . . . . . . . . . 33
Setting up Boot2Docker on Windows . . . . . . . . . . . . . . . . . . . 34
Testing Boot2Docker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Using Boot2Docker with this book . . . . . . . . . . . . . . . . . . . . . . . 36
Docker installation script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Binary installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
The Docker daemon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Conguring the Docker daemon . . . . . . . . . . . . . . . . . . . . . . 39
Checking that the Docker daemon is running . . . . . . . . . . . . . . . 41
Version: v1.0.7 (8f1618c) ii
Contents
Upgrading Docker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Docker user interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Chapter 3 Getting Started with Docker 45
Ensuring Docker is ready . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Building our rst container . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Working with our rst container . . . . . . . . . . . . . . . . . . . . . . . . 49
Container naming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Starting a stopped container . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Attaching to a container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Creating daemonized containers . . . . . . . . . . . . . . . . . . . . . . . . 54
Seeing what's happening inside our container . . . . . . . . . . . . . . . . 55
Inspecting the container's processes . . . . . . . . . . . . . . . . . . . . . . 56
Stopping a daemonized container . . . . . . . . . . . . . . . . . . . . . . . . 57
Finding out more about our container . . . . . . . . . . . . . . . . . . . . . 58
Deleting a container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Chapter 4 Working with Docker images and repositories 62
What is a Docker image? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Listing Docker images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Pulling images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Searching for images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Building our own images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Creating a Docker Hub account . . . . . . . . . . . . . . . . . . . . . . . 73
Using Docker commit to create images . . . . . . . . . . . . . . . . . . 75
Building images with a Dockerle . . . . . . . . . . . . . . . . . . . . . . 77
Building the image from our Dockerle . . . . . . . . . . . . . . . . . . 80
What happens if an instruction fails? . . . . . . . . . . . . . . . . . . . 83
Dockerles and the build cache . . . . . . . . . . . . . . . . . . . . . . . 85
Using the build cache for templating . . . . . . . . . . . . . . . . . . . 85
Viewing our new image . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Launching a container from our new image . . . . . . . . . . . . . . . . 87
Dockerle instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Version: v1.0.7 (8f1618c) iii
剩余279页未读,继续阅读
资源评论
- buaallei2015-10-10非常好的docker教程
changcheng316_zju
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功