Download ebooks file (Ebook) Docker containers build and deploy with Kubernetes, Flannel, Cockpit, and Atomic by Henry, William;Negus, Christopher ISBN 9780134136561, 9780312014117, 9781118999875, 9782147483649, 013413656X, 0312014112, 1118999878, 2147483648 all chapters
Download ebooks file (Ebook) Docker containers build and deploy with Kubernetes, Flannel, Cockpit, and Atomic by Henry, William;Negus, Christopher ISBN 9780134136561, 9780312014117, 9781118999875, 9782147483649, 013413656X, 0312014112, 1118999878, 2147483648 all chapters
com
OR CLICK HERE
DOWLOAD EBOOK
(Ebook) Docker containers build and deploy with Kubernetes, Flannel, Cockpit, and
Atomic by Henry, William;Negus, Christopher ISBN 9780134136561, 9780312014117,
9781118999875, 9782147483649, 013413656X, 0312014112, 1118999878, 2147483648
https://ebooknice.com/product/docker-containers-build-and-deploy-with-
kubernetes-flannel-cockpit-and-atomic-11870004
ebooknice.com
(Ebook) Matematik 5000+ Kurs 2c Lärobok by Lena Alfredsson, Hans Heikne, Sanna
Bodemyr ISBN 9789127456600, 9127456609
https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312
ebooknice.com
(Ebook) SAT II Success MATH 1C and 2C 2002 (Peterson's SAT II Success) by Peterson's
ISBN 9780768906677, 0768906679
https://ebooknice.com/product/sat-ii-success-math-1c-and-2c-2002-peterson-s-sat-
ii-success-1722018
ebooknice.com
(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master the SAT Subject Test: Math
Levels 1 & 2) by Arco ISBN 9780768923049, 0768923042
https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-arco-master-
the-sat-subject-test-math-levels-1-2-2326094
ebooknice.com
(Ebook) Cambridge IGCSE and O Level History Workbook 2C - Depth Study: the United
States, 1919-41 2nd Edition by Benjamin Harrison ISBN 9781398375147, 9781398375048,
1398375144, 1398375047
https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044
ebooknice.com
(Ebook) Docker containers build and deploy with Kubernetes, Flannel, Cockpit, and
Atomic by Henry, William;Negus, Christopher ISBN 9780134136561, 013413656X
https://ebooknice.com/product/docker-containers-build-and-deploy-with-
kubernetes-flannel-cockpit-and-atomic-11870006
ebooknice.com
(Ebook) Linux Bible, 9th Edition by Christopher Negus ISBN 9781118999875, 1118999878
https://ebooknice.com/product/linux-bible-9th-edition-5473906
ebooknice.com
https://ebooknice.com/product/linux-bible-5152126
ebooknice.com
(Ebook) Cracking Containers With Docker and Kubernetes: The definitive guide to
Docker, Kubernetes, and the Container Ecosystem across Cloud and on-premises by
Nisarg Vasavada, Dhwani Sametriya ISBN 9789391030872, 9391030874
https://ebooknice.com/product/cracking-containers-with-docker-and-kubernetes-
the-definitive-guide-to-docker-kubernetes-and-the-container-ecosystem-across-
cloud-and-on-premises-44567160
ebooknice.com
About This E-Book
EPUB is an open, industry-standard format for e-books. However,
support for EPUB and its many features varies across reading
devices and applications. Use your device or app settings to
customize the presentation to your liking. Settings that you can
customize often include font, font size, single or double column,
landscape or portrait mode, and figures that you can click or tap to
enlarge. For additional information about the settings and features
on your reading device or app, visit the device manufacturer’s Web
site.
Many titles include programming code or configuration examples.
To optimize the presentation of these elements, view the e-book in
single-column, landscape mode and adjust the font size to the
smallest setting. In addition to presenting code and configurations in
the reflowable text format, we have included images of the code
that mimic the presentation found in the print book; therefore,
where the reflowable format may compromise the presentation of
the code listing, you will see a “Click here to view code image” link.
Click the link to view the print-fidelity code image. To return to the
previous page viewed, click the Back button on your device or app.
Docker Containers
Build and Deploy with Kubernetes, Flannel,
Cockpit, and Atomic
Christopher Negus
with William Henry
Many of the designations used by manufacturers and sellers to
distinguish their products are claimed as trademarks. Where those
designations appear in this book, and the publisher was aware of a
trademark claim, the designations have been printed with initial
capital letters or in all capitals.
The author and publisher have taken care in the preparation of this
book, but make no expressed or implied warranty of any kind and
assume no responsibility for errors or omissions. No liability is
assumed for incidental or consequential damages in connection with
or arising out of the use of the information or programs contained
herein.
For information about buying this title in bulk quantities, or for
special sales opportunities (which may include electronic versions;
custom cover designs; and content particular to your business,
training goals, marketing focus, or branding interests), please
contact our corporate sales department at
[email protected] or (800) 382-3419.
For government sales inquiries, please contact
[email protected].
For questions about sales outside the U.S., please contact
[email protected].
Visit us on the Web: informit.com/ph
Library of Congress Control Number: 2015948006
Copyright © 2016 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This
publication is protected by copyright, and permission must be
obtained from the publisher prior to any prohibited reproduction,
storage in a retrieval system, or transmission in any form or by any
means, electronic, mechanical, photocopying, recording, or likewise.
To obtain permission to use material from this work, please submit a
written request to Pearson Education, Inc., Permissions Department,
200 Old Tappan Road, Old Tappan, New Jersey 07675, or you may
fax your request to (201) 236-3290.
ISBN-13: 978-0-134-13656-1
ISBN-10: 0-134-13656-X
Text printed in the United States on recycled paper at RR Donnelley
in Crawfordsville, Indiana.
First printing: December 2015
As always, I dedicate this book to my wife, Sheree.
—Christopher Negus
Contents
Preface
Acknowledgments
About the Author
Part I Getting Going with Containers
Chapter 1 Containerizing Applications with Docker
Understanding Pros and Cons of Containerizing Applications
...An Application Running Directly on a Host Computer
...An Application Running Directly within a Virtual Machine
Understanding the Upside of Containers
Understanding Challenges of Containerizing Applications
Understanding What Makes Up Docker
The Docker Project
The Docker Hub Registry
Docker Images and Containers
The docker Command
Approaching Containers
Summary
Chapter 2 Setting Up a Container Run-Time Environment
Configuring a Standard Linux System for Docker
Configuring Ubuntu for Docker
Configuring Fedora for Docker
Configuring Red Hat Enterprise Linux for Docker
Configuring Other Operating Systems for Docker
Configuring a Container-Style Linux System for Docker
Configuring an Atomic Host for Docker
Configuring CoreOS for Docker
Summary
Chapter 3 Setting Up a Private Docker Registry
Getting and Starting a Private Docker Registry
Setting Up a Docker Registry in Fedora
Setting Up a Docker Registry in Ubuntu
Configuring a Private Docker Registry
Configuring the docker-registry Package
Configuring the registry Container
Understanding the Docker Image Namespace
Summary
Part II Working with Individual Containers
Chapter 4 Running Container Images
Running Container Images Interactively
Starting an Interactive Bash Shell
Playing Some Character-Based Games
Running Administrative Commands Inside a Container
Running Containerized Services
Running a Containerized Web Server
Limiting Resources When Running Services in Containers
Running Privileged Containers
Summary
Chapter 5 Finding, Pulling, Saving, and Loading Container
Images
Searching for Images
Searching for Images with the docker Command
Searching for Images on Docker Hub
Searching Other Repositories for Images
Pulling Images from Registries
Saving and Loading Images
Summary
Chapter 6 Tagging Images
Assigning Names to Images
Assigning Tags to Images
Assigning Repository Names to Images
Attaching a User Name to an Image
Attaching a Repository Name to an Image
Summary
Chapter 7 Investigating Containers
Inspecting Images and Containers
Inspecting an Image
Inspecting Base Images with docker inspect
Inspecting Application Images with docker inspect
Looking at the History of an Image
Inspecting Running Containers
Start a Container to Inspect
Inspect an Entire Container Configuration
Inspect Individual Container Attributes
Finding More Ways to Look into Containers
Using docker top to See Container Processes
Using docker attach to Interact with a Service Inside a
Container
Using docker exec to Start a New Process in a Running
Container
Using docker logs to See Container Process Output
Using docker diff to See How a Container Has Changed
Using docker cp to Copy Files from a Container
Summary
Chapter 8 Starting, Stopping, and Restarting Containers
Stopping and Starting a Container
Stopping and Starting a Detached Container
Starting and Stopping an Interactive Container
Restarting a Container
Sending Signals to a Container
Pausing and Unpausing Containers
Waiting for a Container’s Exit Code
Renaming a Container
Creating a Container
Summary
Chapter 9 Configuring Container Storage
Managing Storage for a Container
Using Volumes from the Host
Data Volume Container
Write-Protecting a Bind Mount
Mounting Devices
Mounting Sockets
Storage Strategies for the Docker Host
Attaching External Storage to a Docker Host
Summary
Chapter 10 Configuring Container Networking
Expose Ports to Other Containers
Map Ports Outside the Host
Map a Port from Linked Containers
Connect Containers on Different Hosts
Alternatives to the docker0 Bridge
Changing Network Mode for a Container
Examining Network Options
Changing the Docker Network Bridge
Summary
Chapter 11 Cleaning Up Containers
Making Space for Images and Containers
Removing Images
Removing Individual Images
Removing Multiple Images
Removing Containers
Removing Individual Containers
Removing Multiple Containers
Cleaning Up and Saving Containers
Cleaning Up and Saving an Ubuntu Container
Cleaning Up and Saving a Fedora Container
Summary
Chapter 12 Building Docker Images
Doing a Simple docker build
Setting a Command to Execute from a Dockerfile
Using the CMD Instruction
Using the ENTRYPOINT Instruction
Using the RUN Instruction
Adding Files to an Image from a Dockerfile
Exposing Ports from an Image within a Dockerfile
Assigning Environment Variables in a Dockerfile
Assigning Labels in a Dockerfile
Using Other docker build Command Options
Tips for Building Containers
Clean Up the Image
Keep Build Directory Small
Keep Containers Simple
Manage How Caching Is Done
Summary
Part III Running Containers in Cloud Environments
Chapter 13 Using Super Privileged Containers
Using Super Privileged Containers in Atomic Host
Understanding Super Privileged Containers
Opening Privileges to the Host
Accessing the Host Process Table
Accessing Host Network Interfaces
Accessing Host Inter-Process Communications
Accessing Host File Systems
Preparing to Use Super Privileged Containers
Using the atomic Command
Installing an SPC Image with atomic
Getting Information about an SPC Image with atomic
Running an SPC Image with atomic
Stopping and Restarting an SPC with atomic
Updating an SPC Image
Uninstalling an SPC Image
Trying Some SPCs
Running the RHEL Tools SPC
Running the Logging (rsyslog) SPC
Running the System Monitor (sadc) SPC
Summary
Chapter 14 Managing Containers in the Cloud with Cockpit
Understanding Cockpit
Starting with Cockpit
Adding Servers into Cockpit
Working with Containers from Cockpit
Adding Container Images to Cockpit
Running Images from Cockpit
Working with Network Interfaces from Cockpit
Configuring Storage from Cockpit
Doing Other Administrative Tasks in Cockpit
Managing Administrator Accounts in Cockpit
Open a Terminal in Cockpit
Summary
Part IV Managing Multiple Containers
Chapter 15 Orchestrating Containers with Kubernetes
Understanding Kubernetes
Starting with Kubernetes
Setting Up an All-in-One Kubernetes Configuration
Installing and Starting Up Kubernetes
Starting Up a Pod in Kubernetes
Working with Kubernetes
Summary
Chapter 16 Creating a Kubernetes Cluster
Understanding Advanced Kubernetes Features
Setting Up a Kubernetes Cluster
Step 1: Install Linux
Step 2: Set Up Kubernetes Master
Step 3: Set Up Kubernetes Nodes
Step 4: Set Up Networking with Flannel
Starting Up Pods in a Kubernetes Cluster
Deleting Replication Controllers, Services, and Pods
Summary
Part V Developing Containers
Chapter 17 Developing Docker Containers
Setting Up for Container Development
Choosing a Container Development Environment for Red Hat
Systems
Container Development Environments from Docker
Using Good Development Practices
Gathering or Excluding Files for a Build
Taking Advantage of Layers
Managing Software Packages in a Build
Learning More about Building Containers
Summary
Chapter 18 Exploring Sample Dockerfile Files
Examining Dockerfiles for Official Docker Images
Viewing a CentOS Dockerfile
Viewing a Busybox Dockerfile
Examining Dockerfiles from Open Source Projects
Viewing a WordPress Dockerfile
Viewing the MySQL Dockerfile
Examining Dockerfiles for Desktop and Personal Use
Viewing a Chrome Dockerfile
Viewing a Firefox Dockerfile
Summary
Index
Preface
Docker is a containerization technology at the center of a new wave
for building, packaging, and deploying applications. It has the
potential to impact every aspect of computing, from the application
development process to how applications are deployed and scaled
up and out across massive data centers.
Despite its great popularity, Docker is still a fairly new project,
with many people still not really knowing exactly what Docker is. If
you are one of those people, this book can help you take that first
step, while also opening your eyes to the huge potential that
containerization promises for you down the road. My goals for
leading you into the world of containerization with this book can be
summed up in these ways:
Hands-on learning: I often say this in my books, but I
believe that the best way to learn how technology works is to
get it and use it. To that end, I let you choose from among
several popular Linux systems, show you how to install Docker
on the one you choose, and provide working examples of using
Docker for everything from running a simple container to
building and managing your own container images. That
learning then extends into tools and techniques for
orchestrating and managing containers.
How Docker can benefit you: I explain the benefits of
creating and running applications in containers, instead of
installing software packages (in formats such as RPM or Deb)
and running uncontained applications directly from your hard
disk. Beyond running applications, I also describe how
containerization can benefit software developers and system
administrators.
Essential qualities of Docker: I describe how Docker uses
technologies such as Linux Containers (LXC) to keep containers
separate from other applications running on a host computer or
selectively tap into the host system. These qualities include
how Docker uses name spaces, metadata, and separate file
systems to both manage and secure containerized applications.
To get started, you don’t need to know anything about Docker or
containerization; you can treat this book as your introduction to
Docker. However, this book is also intended to offer an entry into
more advanced Docker-related topics, such as orchestration and
container development.
As you progress through the book, you see specific ways to run
containers, investigate them, stop and start them, save them, and
generally manage them. As you begin creating your own containers,
I discuss techniques to help you make container images that build
and run efficiently. I even step you through build files (which are
called Dockerfiles) that others have created to make their own
containers.
A knowledge of Linux Containers in general, or Docker containers
specifically, is not needed to start using this book. That said,
however, there are other technologies you will use both within your
Docker containers and outside those containers to work with them.
Understanding some of those technologies will make your
experience with Docker that much more fruitful.
B rakeman Joe did not love tramps. His regular work was hard
enough, goodness knows; and when, in addition to it, he had to
make a thorough examination of the whole train at every stopping-
place, peering, by the light of his lantern, between and underneath
the cars for tramps, who might be stealing a ride, he felt that he had
good cause to dislike them. Sometimes he had hard tussles before
dislodging them from their perches and roosts, and many an ugly
blow had he received while performing this duty. Joe had, therefore,
learned to deal very promptly, not to say roughly, with this portion of
the travelling public whenever he found them on or in the cars under
his charge.
On this particular night he had made sure, before starting, that
there was not a single tramp on the train, and had in consequence
been anticipating a comparatively easy trip. And now he had, as he
supposed, discovered a whole nest of them snugly stowed away in car
No. 201. A dog too! It was aggravating, and, under the
circumstances, it is not to be wondered at that he hustled them out of
there without much regard to their feelings.
Both Arthur and Uncle Phin had been suddenly awakened, and
greatly alarmed, when Brakeman Joe first slammed and locked the
door of the car in which they had taken refuge from the storm. They
had a confused idea that they had been asleep, though for how long
they could not tell, and now they could no longer see the lighted
clock above the railway station. It might even be midnight, and time
for their train to come along for all they knew. They shouted, and
kicked against the locked door, and Rusty barked; but all in vain. The
conductor and Brakeman Joe had walked away before these noises
began, and there was no one else to hear them.
Then the engine came and pushed and pulled the car about until
they had not the slightest idea of the direction in which they were
moving. It might be forward or backward, east or west, for all they
could tell. Nor was their situation improved when the train, of which
car No. 201 finally formed a part, pulled out of the railway yard, and
started on its long journey. They had no idea which way it was going,
and Arthur could have cried as he reflected that they might be
travelling in exactly the opposite direction from that they wished to
take, and might be carried hundreds of miles before their car door
was again unlocked. As he could not do this, because he was a Dale,
he only hugged little Rusty, and tried to be comforted by Uncle
Phin’s assurances “Dat de good Lawd was er gwine ter keer for dem,
jes like He did fer de sparrers, whose hairs was all counted so as dey
shouldn’ fall to de groun.”
Arthur’s unhappiness was increased by the fact that he could
nowhere feel his precious book. It had slipped from his grasp as he
slept, and now was nowhere to be found. Thus the first stage of their
journey by rail was a most unhappy one, and they were glad to forget
their sorrows in the sleep that again overcame them a few minutes
before the train made its first stop.
The Arden station was a very small one, in a lonely place, with no
houses near it. It was only a platform with a freight shed at one end,
and a more forlorn place for a stranger to be left on a dark, stormy
night, could hardly be imagined. Arthur and Uncle Phin were not
conscious of the train stopping here, and were only awakened from
their troubled sleep by the light from Brakeman Joe’s lantern
flashing in their faces. They were just sitting up and gazing at him, in
a bewildered way, when this energetic young man hustled them out
of the car in his roughest manner. It was so rough, in fact, that poor
Uncle Phin, impelled by a violent push, slipped on the wet platform,
and fell heavily. He struck one of his knees such a painful blow that,
for a few moments, he was unable to rise, and lay there groaning.
“Aren’t you ashamed of yourself to treat an old man so!” cried
Arthur to Brakeman Joe, as with flashing eyes and quivering lips he
sprang to his companion’s side, and endeavored to assist him to his
feet.
“Well, what business has the old tramp got to be stealing a ride on
my train?” replied the brakeman, sulkily, though at the same time
bending over Uncle Phin and helping him up.
He was not a bad-hearted young man, this Brakeman Joe; but he
was overworked, and much bothered by tramps. Generally he was
good-natured, and was especially kind and gentle with old people, for
he had an old father at home of whom he was the sole support, and
to whom he was devoted. He had not noticed, in the dim light, that
Uncle Phin was old and white-headed. He had only regarded him as
a tramp, who, as everybody knows, is apt to be young and strong, and
well able to perform the labor that he refuses to undertake out of
sheer laziness. So now he helped the prostrate figure to its feet, said
he hoped the old fellow was not much hurt, and then returned to his
task of dragging the six sacks of meal, that were to be left at Arden,
from the car.
“What’s the matter here, Joe?” asked the conductor of the train,
stepping up at this moment.
“Only a couple of stowaways that I found stealing a ride in this
car,” was the answer.
“Tramps, eh?” said the conductor, sharply, flashing the light from
his lantern upon the two trembling figures who stood behind him. “A
dog, too,” he continued, “and I’ll warrant they stole it. I’ve a mind to
take it in payment for their ride. If this was a town I’d have you
fellows arrested and locked up in less than no time. You, and all your
kind, ought to be killed off for the good of the country. As it is I’ll
leave you here to soak in the rain for the rest of the night, and
perhaps some of the worthlessness will be washed out of you by
morning. Hello! what’s this?”
Here the conductor stooped and picked up a small object over
which Brakeman Joe had stumbled, and which he had sent flying out
on to the platform.
It was a book, and the conductor picked it up, wondering where it
could have come from. “‘Andersen’s Fairy Tales,’” he read aloud,
holding it up to his lantern. “The very book my little Kitty was asking
me to get for her only the other day! Well, if this isn’t a find!” Then,
turning to the fly-leaf, he read aloud: “To Prince Dusty, from——”
Here he was interrupted by Arthur, who sprang forward, and,
stretching out his hand for the book, cried: “Please, sir, it’s mine; and
I should feel dreadfully to lose it, and we aren’t tramps, and didn’t
mean to steal a ride. We got locked in by accident, and we have
money enough to pay for everything, and oh! please don’t leave us
here in this lonely place.”
The conductor stared at the boy in amazement. “Well, you do look
like a ‘little Dusty’ sure enough, though I can’t say that you are
exactly what I should have fancied a Prince was. Who are you,
anyway? And where do you want to go to?”
Then Arthur, who was completely covered with white dust from
the meal sacks on which he had been sleeping, told the conductor, in
as few words as possible, of the object of their journey, and how they
happened to be locked into car No. 201. He finished by repeating that
they had money, and would willingly pay for the privilege of riding
further on the train, provided it was bound east. This last question
was asked most anxiously, for as yet the boy had not the slightest
idea of where they were.
“Bound east!” exclaimed the conductor. “Of course we are, and
there goes the ‘New York Limited’ now.” As he spoke, an express
train, of heavy vestibuled cars, thundered past them, with a roar and
a crash, at such tremendous speed that in a second it was gone, and
its two red eyes, looking backward, seemed to wink mockingly at the
snail-like freight train, as they were whisked out of sight.
“Now,” said the conductor as the roar of the express dying away
permitted his voice to be again heard, “I’ll tell you what I will do. You
say you are not tramps, and didn’t mean to stow away in that car,
and that you have money enough to pay for your trip. That all may be
so, and it may not. At any rate I haven’t time to investigate your story
now, for we must pull out of here at once. So you and the old man
and the dog just tumble into that caboose, and I’ll carry you along a
bit further. We’ll see about paying for the trip when you decide how
far you want to go, and you shall read a story out of your book to
Brakeman Joe and me, to pay for the ride you have already had. But
mind,” he added threateningly as Arthur began to thank him, “if I
find that you have been telling me any lies, I’ll have you arrested and
locked up in the very first town we come to.”
CHAPTER XXII.
SAVING THE KEYSTONE EXPRESS.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebooknice.com