IN ACTION - Apphosting.io

Transcription

IN ACTIONJeff NickoloffMANNINGwww.allitebooks.com

Docker in ActionLicensed to StephanieBernal nordicka.n@gmail.com www.allitebooks.com

iiLicensed to StephanieBernal nordicka.n@gmail.com www.allitebooks.com

Docker in ActionJEFF NICKOLOFFMANNINGSHELTER ISLANDLicensed to StephanieBernal nordicka.n@gmail.com www.allitebooks.com

ivFor online information and ordering of this and other Manning books, please visitwww.manning.com. The publisher offers discounts on this book when ordered in quantity.For more information, please contactSpecial Sales DepartmentManning Publications Co.20 Baldwin RoadPO Box 761Shelter Island, NY 11964Email: orders@manning.com 2016 by Manning Publications Co. All rights reserved.No part of this publication may be reproduced, stored in a retrieval system, or transmitted, inany form or by means electronic, mechanical, photocopying, or otherwise, without prior writtenpermission of the publisher.Many of the designations used by manufacturers and sellers to distinguish their products areclaimed as trademarks. Where those designations appear in the book, and ManningPublications was aware of a trademark claim, the designations have been printed in initial capsor all caps.Recognizing the importance of preserving what has been written, it is Manning’s policy to havethe books we publish printed on acid-free paper, and we exert our best efforts to that end.Recognizing also our responsibility to conserve the resources of our planet, Manning books areprinted on paper that is at least 15 percent recycled and processed without elemental chlorine.Manning Publications Co.20 Baldwin RoadPO Box 761Shelter Island, NY 11964Development editor:Technical development editor:Technical r designer:Cynthia KaneRobert WennerNiek PalmLinda RecktenwaldCorbin CollinsMarija TudorMarija TudorISBN: 9781633430235Printed in the United States of America1 2 3 4 5 6 7 8 9 10 – EBM – 21 20 19 18 17 16Licensed to StephanieBernal nordicka.n@gmail.com www.allitebooks.com

contentsforeword xipreface xiiiacknowledgments xvabout this book xviiabout the cover illustrationxixPART 1 KEEPING A TIDY COMPUTER . 11Welcome to Docker1.13What is Docker? 4Containers 4 Containers are not virtualization 5Running software in containers for isolation 5 Shippingcontainers 7 1.2What problems does Docker solve? 7Getting organized 8your computer 102 Improving portability1.3Why is Docker important?1.4Where and when to use Docker1.5Example: “Hello, World” 121.6Summary Protecting111114Running software in containers2.1915Getting help with the Docker command linevLicensed to StephanieBernal nordicka.n@gmail.com www.allitebooks.com15

viCONTENTS2.2Controlling containers: building a website monitor16Creating and starting a new container 17 Runninginteractive containers 18 Listing, stopping, restarting, andviewing output of containers 20 2.3Solved problems and the PID namespace2.4Eliminating metaconflicts: building a website farmFlexible container identificationdependencies 282.5 3024Container state andBuilding environment-agnostic systemsRead-only file systemsinjection 322.6252130Environment variable Building durable containers35Automatically restarting containers 36 Keeping containersrunning with supervisor and startup processes 37 32.7Cleaning up 392.8Summary40Software installation simplified3.1Identifying software 42What is a repository? 423.241Using tags 43Finding and installing software 44Docker Hub from the command line 44 Docker Hub from thewebsite 46 Using alternative registries 48 Images asfiles 48 Installing from a Dockerfile 50 3.3Installation files and isolation 51Image layers in action 51 Layer relationships 53Container file system abstraction and isolation 53 Benefits ofthis toolset and file system structure 54 Weaknesses of unionfile systems 54 3.44Summary55Persistent storage and shared state with volumes4.1Introducing volumes5657Volumes provide container-independent data managementUsing volumes with a NoSQL database 584.2Volume types61Bind mount volumes62 Docker-managed volumesLicensed to StephanieBernal nordicka.n@gmail.com www.allitebooks.com6458

viiCONTENTS4.3Sharing volumes66Host-dependent sharingvolumes-from flag 674.4Generalized sharing and the The managed volume life cycleVolume ownership4.56669 69Cleaning up volumes70Advanced container patterns with volumes71Volume container pattern 72 Data-packed volumecontainers 73 Polymorphic container pattern 74 4.65Summary75Network exposure5.177Networking background78Basics: protocols, interfaces, and ports 78networks, NAT, and port forwarding 795.2 Bigger picture:Docker container networking 81The local Docker network topologyarchetypes 825.3Closed containers5.4Bridged containers81 Four network container8385Reaching out 85 Custom name resolution 86 Openinginbound communication 89 Inter-containercommunication 91 Modifying the bridge interface 92 5.5Joined containers945.6Open containers5.7Inter-container dependencies9697Introducing links for local service discovery 97 Linkaliases 99 Environment modifications 100 Link natureand shortcomings 102 5.86Summary 103Limiting risk with isolation6.1Resource allowancesMemory limits6.2Shared memory105 104105CPU107 Access to devices109109Sharing IPC primitives between containersopen memory container 111110 Using anLicensed to StephanieBernal nordicka.n@gmail.com www.allitebooks.com

viiiCONTENTS6.3Understanding users112Introduction to the Linux user namespace 112 Working withthe run-as user 113 Users and volumes 115 6.4Adjusting OS feature access with capabilities6.5Running a container with full privileges6.6Stronger containers with enhanced toolsSpecifying additional security optionsLXC 1216.7120118119Fine-tuning with Build use-case-appropriate containers122Applications 122 High-level system servicesLow-level system services 123123 6.8Summary117123PART 2 PACKAGING SOFTWARE FOR DISTRIBUTION . 1257Packaging software in images7.1127Building Docker images from a container 127Packaging Hello World 128 Preparing packaging forGit 129 Reviewing file system changes 129 Committinga new image 130 Configurable image attributes 131 7.2Going deep on Docker images and layersAn exploration of union file systems 132images, layers, repositories, and tags 135size and layer limits 1388 132ReintroducingManaging image7.3Exporting and importing flat file systems7.4Versioning best practices7.5Summary140141143Build automation and advanced image considerations8.1Packaging Git with a Dockerfile8.2A Dockerfile primer 149Metadata instructions150 145146File system instructions8.3Injecting downstream build-time behavior8.4Using startup scripts and multiprocess containersEnvironmental preconditions validationprocesses 160159 153156159InitializationLicensed to StephanieBernal nordicka.n@gmail.com www.allitebooks.com

ixCONTENTS8.5Building hardened application images161Content addressable image identifiers 162 Userpermissions 163 SUID and SGID permissions 165 8.69Summary166Public and private software distribution9.1Choosing a distribution method 169A distribution spectrum9.2168169Selection criteria Publishing with hosted registries170172Publishing with public repositories: Hello World via DockerHub 172 Publishing public projects with automatedbuilds 175 Private hosted repositories 177 9.3Introducing private registriesUsing the registry imageyour registry 1829.4181179Consuming images from Manual image publishing and distribution183A sample distribution infrastructure using the File TransferProtocol 1859.5Image source distribution workflows188Distributing a project with Dockerfile on GitHub9.610Summary190Running customized registries10.1192Running a personal registry194Reintroducing the Image 194Customizing the Image 19710.2189 Introducing the V2 APIEnhancements for centralized registries195198Creating a reverse proxy 199 Configuring HTTPS (TLS) onthe reverse proxy 201 Adding an authentication layer 205Client compatibility 208 Before going to production 210 10.3Durable blob storage 212Hosted remote storage with Microsoft’s Azure 213 Hostedremote storage with Amazon’s Simple Storage Service 214Internal remote storage with RADOS (Ceph) 216 10.4Scaling access and latency improvementsIntegrating a metadata cache 217with storage middleware 219 217Streamline blob transferLicensed to StephanieBernal nordicka.n@gmail.com www.allitebooks.com

xCONTENTS10.5Integrating through notifications10.6Summary221227PART 3 MULTI-CONTAINER AND MULTI-HOSTENVIRONMENTS . 22911Declarative environments with Docker Compose11.1231Docker Compose: up and running on day one 232Onboarding with a simple development environment 232A complicated architecture: distribution and Elasticsearchintegration 23411.2Iterating within an environment236Build, start, and rebuild services 237 Scale and removeservices 240 Iteration and persistent state 242Linking problems and the network 243 11.3Starting a new project: Compose YAML in three samplesPrelaunch builds, the environment, metadata, andnetworking 244 Known artifacts and bind-mountvolumes 245 Volume containers and extended services 11.412Summary247Clusters with Machine and Swarm12.1248Introducing Docker Machine 249Building and managing Docker Machines 250Docker clients to work with remote daemons 25212.2Introducing Docker Swarm Configuring255Building a Swarm cluster with Docker Machineextends the Docker Remote API 25812.3246255 SwarmSwarm scheduling 261The Spread algorithm 261 Fine-tune scheduling withfilters 263 Scheduling with BinPack and Random 267 12.4Swarm service discovery269Swarm and single-host networking 269 Ecosystem servicediscovery and stop-gap measures 271 Looking forward tomulti-host networking 272 12.5Summaryindex274275Licensed to Stephanie Bernal nordicka.n@gmail.com 243

forewordI heard about Docker for the first time in a YouTube video that was posted to HackerNews from PyCon 2013. In his five-minute lightning talk entitled “The Future ofLinux Containers,” the creator of Docker, Solomon Hykes, was unveiling the future ofhow we ship and run software to the public—not just in Linux, but on nearly all platforms and architectures. Although he was abruptly silenced at the five-minute mark, itwas clear to me that this technique of running Linux applications in sandboxedenvironments, with its user-friendly command-line tool and unique concepts such asimage layering, was going to change a lot of things.Docker vastly changed many software development and operations paradigms allat once. The ways we architect, develop, ship, and run software before and afterDocker are vastly different. Although Docker does not prescribe a certain recipe, itforces people to think in terms of microservices and immutable infrastructure.Once Docker was more widely adopted, and as people started to investigate thelow-level technologies utilized by Docker, it became clearer that the secret to Docker’ssuccess was not the technology itself, but the human-friendly interface, APIs, and ecosystem around the project.Many big companies such as Google, Microsoft, and IBM have gathered around theDocker project and worked together to make it even better rather than creating acompetitor to it. In fact, companies like Microsoft, Joyent, Intel, and VMware haveswapped out Docker’s Linux containers implementation but kept the novel Dockercommand-line interface for their own container offerings. In only two years, manynew companies have sprouted up to enhance the developer experience and fill in theblanks of the Docker ecosystem—the sign of a healthy and enthusiastic communityaround Docker.For my own part, I began helping Microsoft adopt and contribute to Docker bypublishing Microsoft’s first official Docker image for cross-platform ASP.NET. My nextxiLicensed to Stephanie Bernal nordicka.n@gmail.com

xiiFOREWORDcontribution was porting the Docker command-line interface to Windows. This project helped many Windows developers become familiar with Docker and laid the foundation for Microsoft’s long journey of contributing to the Docker project. TheWindows porting project also skyrocketed me to the top Docker contributor spot formore than two months. Later on, we contributed many other bits and pieces to makesure Docker became a first-class citizen on Microsoft’s Azure cloud offering. Our nextbig step is Windows Containers, a new feature in Windows Server 2016, which is fullyintegrated with Docker.It is exciting to know that we’re still at the start of the containers revolution. Thescene moves incredibly fast, as new technologies and open source tools emerge daily.Everything we take for granted today can and will change in the next few months. Thisis an area where innovators and the greatest minds of our industry are collaboratingto build tools of mass innovation and make the problem of shipping and running software at scale one less thing to worry about for the rest of the software industry.Through his many online articles about Docker and microservices, Jeff Nickoloffhas shown himself to be the champion of the nascent Docker community. His wellwritten, thorough explanations of some very technical topics have allowed developersto quickly learn and use the Docker ecosystem for all its benefits, and, equally important, he notes its drawbacks. In this book, he goes from zero to Docker, shows practices of deploying Docker in production, and demonstrates many features of Dockerwith comprehensive descriptions and comparisons of various ways of achieving thesame task.While reading this book, not only will you learn how to use Docker effectively,you’ll also grasp how it works, how each detailed feature of Docker is meant to beused, and the best practices concocted for using Docker in production. I personallyhad many “Oh, that’s what this feature is for” moments while reading this book.Although writing a book about a technology that moves at an incredible pace is verymuch like trying to paint a picture of a car moving at 60 mph, Jeff has done a fantasticjob at both covering cutting-edge features in Docker and laying a solid foundationthroughout the book. This foundation builds an appreciation and understanding forthe philosophy of containers and microservices that is unlikely to change, no matterwhat Docker looks like in the coming months and years.I hope you find this book as enjoyable and educational as I did.AHMET ALP BALKANOPEN SOURCE SOFTWARE ENGINEER AT MICROSOFT,DOCKER CONTRIBUTORLicensed to Stephanie Bernal nordicka.n@gmail.com

prefaceIn 2011, I started working at Amazon.com. In that first week my life was changed as Ilearned how to use their internal build, dependency modeling, and deployment tooling. This was the kind of automated management I had always known was possible buthad never seen. I was coming from a team that would deploy quarterly and take 10hours to do so. At Amazon I was watching rolling deployments push changes I hadmade earlier that day to hundreds of machines spread all over the globe. If big techfirms had an engineering advantage over the rest of the corporate landscape, this was it.Early in 2013, I wanted to work with Graphite (a metrics collection and graphingsuite). One day I sat down to install the software and start integrating a personal project. At this point I had several years of experience working with open source applications, but few were as dependent on such large swaths of the Python ecosystem. Theinstallation instructions were long and murky. Over the next several hours, I discovered many undocumented installation steps. These were things that might have beenmore obvious to a person with deeper Python ecosystem knowledge. After pouringover several installation guides, reading through configuration files, and fighting anepic battle through the deepest parts of dependency hell, I threw in the towel.Those had been some of the least inspiring hours of my life. I wanted nothing todo with the project. To make matters worse, I had altered my environment in a waythat was incompatible with other software that I use regularly. Reverting those changestook an embarrassingly long time.I distinctly remember sitting at my desk one day in May that year. I was betweentasks when I decided to check Hacker News for new ways to grow my skillset. Articlesabout a technology called Docker had made the front page a few times that week.That evening I decided to check it out. I hit the site and had the software installedwithin a few minutes. I was running Ubuntu on my desktop at home, and Docker onlyhad two dependencies: LXC and the Linux kernel itself.xiiiLicensed to Stephanie Bernal nordicka.n@gmail.com

xivPREFACELike everyone else, I kicked the tires with a “Hello, World” example, but learnedlittle. Next I fired up Memcached. It was downloaded and running in under a minute.Then I started WordPress, which came bundled with its own MySQL server. I pulled acouple different Java images, and then Python images. Then my mind flashed back tothat terrible day with Graphite. I popped over to the Docker Index (this was beforeDocker Hub) and did a quick search.The results came back, and there it was. Some random user had created a Graphiteimage. I pulled it down and created a new container. It was running. A simple but fullyconfigured Graphite server was running on my machine. I had accomplished in lessthan a minute of download time what I had failed to do with several hours a fewmonths earlier. Docker was able to demonstrate value with the simplest of examplesand minimum effort. I was sold.Over the next week, I tried the patience of a close friend by struggling to direct ourconversations toward Docker and containers. I explained how package managementwas nice, but enforcing file system isolation as a default solved several managementproblems. I rattled on about resource efficiency and provisioning latency. I repeatedthis conversation with several other colleagues and fumbled through the containerstory. Everyone had the same set of tired questions, “Oh, it’s like virtualization?”and “Why do I need this if I have virtual machines?” The more questions peopleasked, the more I wanted to know. Based on the popularity of the project, this is astory shared by many.I began including sessions about Docker when I spoke publicly. In 2013 and 2014,only a few people had heard of Docker, and even fewer had actually tried the software.For the most part, the crowds consisted of a few skeptical system administrator typesand a substantial number of excited developers. People reacted in a multitude ofways. Some were pure rejectionists who clearly preferred the status quo. Others couldsee problems that they experienced daily solved in a matter of moments. Those people reacted with an excitement similar to mine.In the summer of 2014, an associate publisher with Manning called me to talkabout Docker. After a bit more than an hour on the phone he asked me if there wasenough content there for a book. I suggested that there was enough for a few books.He asked me if I was interested in writing it, and I became more excited than I hadbeen for some time. That fall I left Amazon.com and started work on Docker in Action.Today, I'm sitting in front of the finished manuscript. My goal in writing this bookwas to create something that would help people of mixed backgrounds get up tospeed on Docker as quickly as possible, but in such a way that they understand theunderlying mechanisms. The hope is that with that knowledge, readers can understand how Docker has been applied to certain problems, and how they might apply itin their own use-cases.Licensed to Stephanie Bernal nordicka.n@gmail.com

acknowledgmentsI believe that I’ve spent enough of my life doing easy things. Before I began this book,I knew that writing it would require a high degree of discipline and an unendingstream of motivation. I was not disappointed.First I’d like to acknowledge Manning Publications for the opportunity to publishthis work. I’d like to thank Ahmet Alp Baken for writing a foreword to the book, aswell as Niek Palm for giving the whole manuscript a technical proofread. Many othersreviewed the manuscript and offered comments at various stages of development,including Robert Wenner, Jean-Pol Landrain, John Guthrie, Benoît Benedetti,Thomas Peklak, Jeremy Gailor, Fernando Fraga Rodrigues, Gregor Zurowski, PeterSellars, Mike Shepard, Peter Krey, Fernando Kobayashi, and Edward Kuns.In this and most other difficult ventures, success is dependent on the collectivecontributions of a support network. I wouldn't be here today without contributionsfrom the following: Portia Dean, for her partnership and support over the last year. Portia, you aremy partner, my righteous and stubborn center. Without you I would have lostmy mind somewhere in this maze of a year. I’ve loved the adventure and can’twait for what comes next.My parents, Kathy and Jeff Nickoloff, Sr., for supporting my technical curiosityfrom a young age and cultivating my strong will.Neil Fritz, for hacking out projects with me over the last 15 years and alwaysbeing open to getting Slices Pizza.Andy Will and the strong engineers of PHX2, for welcoming me to Amazon andalways raising our technical bar. Working with them was an education in itself.Nick Ciubotariu, for fighting the good fight and raising the bar for technicalleadership.xvLicensed to Stephanie Bernal nordicka.n@gmail.com

xviACKNOWLEDGMENTS Cartel Coffee Lab, I spent more time in your HQ than I did my own house thisyear. You have one of the best roasts in the world. People in San Francisco aremissing out.Finally, I want to acknowledge my like-minded friends around the world who’veshared in some part of this journey through learning, sharing, challenging, or justlistening. #noguiLicensed to Stephanie Bernal nordicka.n@gmail.com

about this bookDocker in Action’s purpose is to introduce developers, system administrators, andother computer users of a mixed skillset to the Docker project and Linux containerconcepts. Both Docker and Linux are open source projects with a wealth of onlinedocumentation, but getting started with either can be a daunting task.Docker is one of the fastest-growing open source projects ever, and the ecosystemthat has grown around it is evolving at a similar pace. For these reasons, this bookfocuses on the Docker toolset exclusively. This restriction of scope should both helpthe material age well and help readers understand how to apply Docker features totheir specific use-cases. Readers will be prepared to tackle bigger problems andexplore the ecosystem once they develop a solid grasp of the fundamentals covered inthis book.RoadmapThis book is split into three parts.Part 1 introduces Docker and container features. Reading it will help you understand how to install and uninstall software distributed with Docker. You’ll learn how torun, manage, and link different kinds of software in different container configurations. Part 1 covers the basic skillset that every Docker user will need.Part 2 is focused on packaging and distributing software with Docker. It covers theunderlying mechanics of Docker images, nuances in file sizes, and a survey of different packaging and distribution methods. This part wraps up with a deep dive into theDocker Distribution project.Part 3 explores multi-container projects and multi-host environments. Thisincludes coverage of the Docker Compose, Machine, and Swarm projects. These chapters walk you through building and deploying multiple real world examples thatshould closely resemble large-scale server software you’d find in the wild.xviiLicensed to Stephanie Bernal nordicka.n@gmail.com

xviiiABOUT THIS BOOKCode conventions and downloadsThis book is about a multi-purpose tool, and so there is very little “code” includedin the book. In its place are hundreds of shell commands and configuration files.These are typically provided in POSIX-compliant syntax. Notes for Windows usersare provided where Docker exposes some Windows-specific features. Care wastaken to break up commands into multiple lines in order to improve readabilityor clarify annotations. Referenced repositories are available on Docker Hub(https://hub.docker.com/u/dockerinaction/) with sources hosted on GitHub(https://github.com/dockerinaction). No prior knowledge of Docker Hub orGitHub is required to run the examples.This book uses several open source projects to both demonstrate various featuresof Docker and help the reader shift software-management paradigms. No single software “stack” or family is highlighted other than Docker itself. Working through theexamples, the reader will use tools such as WordPress, Elasticsearch, Postgres, shellscripts, Netcat, Flask, JavaScript, NGINX, and Java. The sole commonality is a dependency on the Linux kernel.About the authorJeff Nickoloff builds large-scale services, writes about technology, and helps peopleachieve their product goals. He has done these things at Amazon.com, Limelight Networks, and Arizona State University. After leaving Amazon in 2014, he founded a consulting company and focused on delivering tools, training, and best practices forFortune 100 companies and startups alike. If you’d like to chat or work together, youcan find him at http://allingeek.com, or on Twitter as @allingeek.Author OnlinePurchase of Docker in Action includes free access to a private web forum run by Manning Publications where you can make comments about the book, ask technical questions, and receive help from the author and from other users. To access the forumand subscribe to it, point your web browser to www.manning.com/books/docker-inaction. This page provides information on how to get on the forum once you’re registered, what kind of help is available, and the rules of conduct on the forum.Manning’s commitment to our readers is to provide a venue where a meaningfuldialog between individual readers and between readers and the author can take place.It is not a commitment to any specific amount of participation on the part of theauthor, whose contribution to the Author Online remains voluntary (and unpaid). Wesuggest you try asking the author some challenging questions lest his interest stray!The Author Online forum and the archives of previous discussions will be accessiblefrom the publisher’s website as long as the book is in print.Licensed to Stephanie Bernal nordicka.n@gmail.com

about the cover illustrationThe figure on the cover of Docker in Action is captioned “The Angler.” The illustrationis taken from a nineteenth-century collection of works by many artists, edited by LouisCurmer and published in Paris in 1841. The title of the collection is Les Français peintspar eux-mêmes, which translates as The French People Painted by Themselves. Each illustration is finely drawn and colored by hand and the rich variety of drawings in the collection reminds us vividly of how culturally apart the world’s regions, towns, villages, andneighborhoods were just 200 years ago. Isolated from each other, people spoke different dialects and languages. In the streets or in the countryside, it was easy to identifywhere they lived and what their trade or station in life was just by their dress.Dress codes have changed since then and the diversity by region, so rich at thetime, has faded away. It is now hard to tell apart the inhabitants of different continents, let alone different towns or regions. Perhaps we have traded cultural diversityfor a more varied personal life—certainly for a more varied and fast-paced technological life.At a time when it is hard to tell one computer book from another, Manning celebrates the inventiveness and initiative of the computer business with book coversbased on the rich diversity of regional life of two centuries ago, brought back to life bypictures from collections such as this one.xixLicensed to StephanieBernal nordicka.n@gmail.com www.allitebooks.com

xxABOUT THE COVER ILLUSTRATIONLicensed to Stephanie Bernal nordicka.n@gmail.com

Part 1Keeping a Tidy ComputerIsolation is a core concept to so many computing patterns, resource management strategies, and general accounting practices that it is difficult to even begincompiling a list. Someone who learns how Linux containers provide isolation forrunning programs and how to use Docker to control that isolation can accomplish amazing feats of reuse, resource efficiency, and system simplification.A thorough understanding of the material in this part is a solid foundationfor every reader to take on the rapidly growing Docker and container ecosystem.Like the Docker tool set itself, the pieces covered here provide building blocksto solving larger problems. For that reason, I suggest that you try to resist theurge to skip ahead. It may take some time to get to the specific question that ison your mind, but I’m confident that you’ll have more than a few revelationsalong the way.Licensed to Stephanie Bernal nordicka.n@gmail.com

2FCHAPTERLicensed to Stephanie Bernal nordicka.n@gmail.com

Welcome to DockerThis chapter covers What Docker is An introduction to containers How Docker addresses software problems thatmost people tolerate When, where, and why you should use Docker Example: “Hello, World”If you’re anything like me, you prefer to do only what is necessary to accomplish anunpleasant or mundane task. It’s likely that you’d prefer tools that are simple to useto great effect over those that are complex or time-consuming. If I’m right, then Ithink you’ll be interested in learning about Docker.Suppose you like to try out new Linux software but are worried about runningsomething malicious. Running that software with Docker is a great first step in protecting your computer because Docker helps even the most basic software userstake advantage of powerful security tools.If you’re a system administrator, making Doc

12.1 Introducing Docker Machine 249 Building and managing Docker Machines 250 Configuring Docker clients to work with remote daemons 252 12.2 Introducing Docker Swarm 255 Building a Swarm cluster with Docker Machine 255 Swarm extends the Docker Remote API 258 12.3 Swarm scheduling 261 The Spread algorithm 261 Fine-tune scheduling with