The Docker Book

所需积分/C币:10 2016-04-28 23:17:04 5.61MB PDF
收藏 收藏

A new book designed for SysAdmins, Operations staff, Developers and DevOps who are interested in deploying the open source container service Docker., In this book, we'll will walk you through installing, deploying, managing, and extending Docker. We're going to do that by first introducing you to th
Contents Page List of Figures V111 st of Listings XIX Foreword Who is this book for? Credits and Acknowledgments Technical reviewers Scott collier John ferlito 2 Paul nasrat Technical illustrator Proofreader Author 4 Conventions in the book 4 Code and Examples 鲁·· Colophon Errata Version 5 Copyright...... Chapter 1 Introduction Introducing Docker............ 8 An easy and lightweight way to model reality A logical segregation of duties Fast, efficient development life cycle 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 configuration management 14 Docker's technical components 16 What's in the book? 16 Docker resources 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 Boot 2 Docker 33 Boot2Docker installation on windows 33 Installing Boot2Docker on Windows 33 Setting up boot 2Docker on Windows 34 Testing Boot2Docker 35 Using Boot2Docker with this book 36 Docker installation script .,37 Binary installation 38 The docker daemon 39 Configuring the docker daemon 39 Checking that the docker daemon is running Version: v1.0.7(8f1618C) Contents Upgrading docker pg 8 43 Docker user interfaces 43 Summary 43 Chapter 3 Getting Started with Docker 45 Ensuring Docker is ready 45 Building our first container 46 Working with our first container 49 Container naming 52 Starting a stopped container 52 Attaching to a container ,,,,,,,,,,.53 Creating demonized containers Seeing what's happening inside our container.............. 55 Inspecting the container's processes 56 Stopping a demonized 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 Creating a docker hub account 73 Using Docker commit to create images 75 Building images with a dockerfile 77 Building the image from our dockerfile 80 What happens if an instruction fails? 83 Dockerfiles 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 Dockerfile instructions ,,,,,,,,,,,,,,91 Version: v1.0.7(8/1618c) Contents Pushing images to the Docker Hub 104 Automated builds 106 Deleting an image ,,,,,,,.,..,111 Running your own Docker registry ,,,.114 Running a registry from a container.............. 114 Testing the new registry 114 Alternative indexes 116 Quay 116 Summary 116 Chapter 5 Testing with Docker 117 Using Docker to test a static website 118 An initial dockerfile 118 Building our nginx image ,121 Building containers from our Nginx image 123 Editing our website 125 Using Docker to build and test a web application............... 127 Building our Sinatra application 127 Creating our Sinatra container 128 Building a Redis image and container.......... 131 Connecting to the redis container 132 Our redis connection 137 Linking docker containers 139 Using our container link to communicate 143 Using Docker for continuous integration 146 Build a jenkins and docker server 148 Create a new Jenkins job 153 Running our Jenkins job ...158 Next steps with our Jenkins job 160 Summary of our Jenkins setup 160 Multi-configuration Jenkins 161 Create a multi-configuration job ,,,,,,,,,,161 Testing our multi-configuration job ,,,,,,,,,166 Summary of our multi-configuration Jenkins ,,,,,,,,,,168 Other alternatives 168 Version: v1.0.7(8/1618c) Contents Drone 168 Shippable .169 S Innd 169 Chapter 6 Building services with Docker 170 Building our first application .170 The jekyll base image .171 Building the jekyll base image 172 The apache image 173 Building the jekyll Apache image 175 Launching our Jekyll site ,,,,,,,,,,,176 dating our Jekyll site 179 Backing up our Jekyll volume................ 181 Extending our Jekyll website example 182 Building a Java application server with Docker 183 A WAR file fetcher 183 Fetching a War file 184 Our Tomcat 7 application server 186 Running our WAR file ,,,,188 Building on top of our Tomcat application server............ 189 A multi-container application stack .,,,,,,,,,,,,,,,,,192 The Node. js image 193 The redis base image 196 The redis primary image 197 The Redis replica image 198 Creating our Redis back-end cluster .199 Creating our node container 205 Capturing our application logs ...206 Summary of our Node stack 210 Managing Docker containers without SSh .211 Summary 212 Chapter 7 Using the Docker API 214 The Docker APis .,,.214 First steps with the remote api 215 Version: v1.0.7(8/1618c) Contents Testing the Docker Remote aPI 217 Managing images with the API .218 Managing containers with the aPI ......,...221 Improving PRov ,225 Authenticating the Docker Remote API 230 Create a Certificate Authority 231 Create a server certificate signing request and key 232 Configuring the docker daemon 235 Creating a client certificate and key .237 Configuring our Docker client for authentication 239 Summary . ,,241 Chapter8 Getting help and extending Docker 242 Getting help 243 The Docker user and dev mailing lists 243 Docker on irc 243 Docker on github 244 Reporting issues for Docker 244 Setting up a build environment 245 Install docker ,,,,245 Install source and build tools ...,,,,.,,,,,,,,.,,,245 Check out the source 245 Contributing to the documentation 246 Build the environment Running the tests 248 Use Docker inside our development environment 249 Submitting a pull request ...250 Merge approval and maintainers 252 SU ummar 253 Index 254 Version: v1.0.7(8/1618c) List of Figures 1.1 Docker architecture 2.1 Installing Boot2Docker on OSX................... 31 2.2 Running boot2Docker on osX 32 2.3 Installing Boot2 Docker on Windows 34 2.4 Running boot2 Docker on windows 35 3.1 Listing Docker containers 51 4.1 The Docker filesystem layers 64 4.2 Docker hub 67 4.3 Creating a Docker hub account 74 4.4 Your image on the docker hub 105 4.5 The Add Repository button ,,,,,,,,,,,,,,..106 4.6 Account linking options 107 4.7 Linking your GitHub account 108 4.8 Selecting your repository 109 4.9 Configuring your Automated Build 110 4.10Creating your Automated Build ,111 4.1lDeleting a repository. ,.113 5.1 Browsing the nginx test site 125 5.2 Browsing the edited Nginx test site 126 5.3 Browsing the Jenkins server. 152 5. 4 Creating a new Jenkins job. 153 5.5 Jenkins job details part 1 154 5.6 Jenkins job details part 2 157 5.7 Running the Jenkins job ,,,,,158 List of figures 5.8 The Jenkins job details 159 5.9 The Jenkins job console output 159 5. 10Creating a multi-configuration job. ,,,,,,,,,,,,161 5.11Configuring a multi-configuration job Part 1 ..162 5.12Configuring a multi-configuration job Part 2 163 5.130ur Jenkins multi-configuration job 165 5.14The centos sub-job. 166 5.15The centos sub-job details 167 5.16The centos sub-job console output. 67 6. 1 Our Jekyll website ,,,,,,,,,,.179 6.2 Our updated jekyll website 180 6. 3 Our Tomcat sample application ,,,,,,,,188 6. 4 Our TProv web application 190 6. 5 Downloading a sample application. 191 6.6 Listing the Tomcat instances ,191 6. 7 Our Node application ,.205 Version: v1.0.7(8/1618c)

试读 127P The Docker Book
立即下载 身份认证后 购VIP低至7折
wxm_19840314 找了半天,终于找到英文版的资源 看了一眼,资源 是真的; 不过就是花的积分有点多,心疼;
关注 私信
The Docker Book 10积分/C币 立即下载
The Docker Book第1页
The Docker Book第2页
The Docker Book第3页
The Docker Book第4页
The Docker Book第5页
The Docker Book第6页
The Docker Book第7页
The Docker Book第8页
The Docker Book第9页
The Docker Book第10页
The Docker Book第11页
The Docker Book第12页
The Docker Book第13页
The Docker Book第14页
The Docker Book第15页
The Docker Book第16页
The Docker Book第17页
The Docker Book第18页
The Docker Book第19页
The Docker Book第20页

试读结束, 可继续阅读

10积分/C币 立即下载