Preface |
|
xv | |
Acknowledgments |
|
xxi | |
About the Author |
|
xxiii | |
Part I Getting Going with Containers |
|
1 | (48) |
|
Chapter 1 Containerizing Applications with Docker |
|
|
3 | (14) |
|
Understanding Pros and Cons of Containerizing Applications |
|
|
4 | (4) |
|
An Application Running Directly on a Host Computer |
|
|
4 | (1) |
|
An Application Running Directly within a Virtual Machine |
|
|
5 | (1) |
|
Understanding the Upside of Containers |
|
|
5 | (2) |
|
Understanding Challenges of Containerizing Applications |
|
|
7 | (1) |
|
Understanding What Makes Up Docker |
|
|
8 | (5) |
|
|
8 | (1) |
|
|
9 | (1) |
|
Docker Images and Containers |
|
|
10 | (1) |
|
|
11 | (2) |
|
|
13 | (1) |
|
|
14 | (3) |
|
Chapter 2 Setting Up a Container Run-Time Environment |
|
|
17 | (18) |
|
Configuring a Standard Linux System for Docker |
|
|
18 | (11) |
|
Configuring Ubuntu for Docker |
|
|
18 | (3) |
|
Configuring Fedora for Docker |
|
|
21 | (4) |
|
Configuring Red Hat Enterprise Linux for Docker |
|
|
25 | (2) |
|
Configuring Other Operating Systems for Docker |
|
|
27 | (2) |
|
Configuring a Container-Style Linux System for Docker |
|
|
29 | (5) |
|
Configuring an Atomic Host for Docker |
|
|
29 | (3) |
|
Configuring CoreOS for Docker |
|
|
32 | (2) |
|
|
34 | (1) |
|
Chapter 3 Setting Up a Private Docker Registry |
|
|
35 | (14) |
|
Getting and Starting a Private Docker Registry |
|
|
36 | (7) |
|
Setting Up a Docker Registry in Fedora |
|
|
37 | (3) |
|
Setting Up a Docker Registry in Ubuntu |
|
|
40 | (3) |
|
Configuring a Private Docker Registry |
|
|
43 | (3) |
|
Configuring the docker-registry Package |
|
|
43 | (3) |
|
Configuring the registry Container |
|
|
46 | (1) |
|
Understanding the Docker Image Namespace |
|
|
46 | (2) |
|
|
48 | (1) |
Part II Working with Individual Containers |
|
49 | (124) |
|
Chapter 4 Running Container Images |
|
|
51 | (14) |
|
Running Container Images Interactively |
|
|
54 | (5) |
|
Starting an Interactive Bash Shell |
|
|
54 | (2) |
|
Playing Some Character-Based Games |
|
|
56 | (1) |
|
Running Administrative Commands Inside a Container |
|
|
57 | (2) |
|
Running Containerized Services |
|
|
59 | (4) |
|
Running a Containerized Web Server |
|
|
59 | (3) |
|
Limiting Resources When Running Services in Containers |
|
|
62 | (1) |
|
Running Privileged Containers |
|
|
63 | (1) |
|
|
64 | (1) |
|
Chapter 5 Finding, Pulling, Saving, and Loading Container Images |
|
|
65 | (14) |
|
|
66 | (7) |
|
Searching for Images with the docker Command |
|
|
66 | (3) |
|
Searching for Images on Docker Hub |
|
|
69 | (1) |
|
Searching Other Repositories for Images |
|
|
70 | (3) |
|
Pulling Images from Registries |
|
|
73 | (3) |
|
Saving and Loading Images |
|
|
76 | (1) |
|
|
77 | (2) |
|
|
79 | (8) |
|
Assigning Names to Images |
|
|
80 | (1) |
|
|
81 | (2) |
|
Assigning Repository Names to Images |
|
|
83 | (3) |
|
Attaching a User Name to an Image |
|
|
83 | (2) |
|
Attaching a Repository Name to an Image |
|
|
85 | (1) |
|
|
86 | (1) |
|
Chapter 7 Investigating Containers |
|
|
87 | (22) |
|
Inspecting Images and Containers |
|
|
88 | (1) |
|
|
88 | (4) |
|
Inspecting Base Images with docker inspect |
|
|
89 | (1) |
|
Inspecting Application Images with docker inspect |
|
|
90 | (2) |
|
Looking at the History of an Image |
|
|
92 | (1) |
|
Inspecting Running Containers |
|
|
92 | (11) |
|
Start a Container to Inspect |
|
|
93 | (1) |
|
Inspect an Entire Container Configuration |
|
|
94 | (5) |
|
Inspect Individual Container Attributes |
|
|
99 | (4) |
|
Finding More Ways to Look into Containers |
|
|
103 | (4) |
|
Using docker top to See Container Processes |
|
|
103 | (1) |
|
Using docker attach to Interact with a Service Inside a Container |
|
|
104 | (1) |
|
Using docker exec to Start a New Process in a Running Container |
|
|
105 | (1) |
|
Using docker logs to See Container Process Output |
|
|
106 | (1) |
|
Using docker di f f to See How a Container Has Changed |
|
|
106 | (1) |
|
Using docker cp to Copy Files from a Container |
|
|
107 | (1) |
|
|
107 | (2) |
|
Chapter 8 Starting, Stopping, and Restarting Containers |
|
|
109 | (12) |
|
Stopping and Starting a Container |
|
|
109 | (4) |
|
Stopping and Starting a Detached Container |
|
|
110 | (2) |
|
Starting and Stopping an Interactive Container |
|
|
112 | (1) |
|
|
113 | (1) |
|
Sending Signals to a Container |
|
|
114 | (1) |
|
Pausing and Unpausing Containers |
|
|
115 | (1) |
|
Waiting for a Container's Exit Code |
|
|
116 | (1) |
|
|
117 | (1) |
|
|
117 | (1) |
|
|
118 | (3) |
|
Chapter 9 Configuring Container Storage |
|
|
121 | (12) |
|
Managing Storage for a Container |
|
|
122 | (5) |
|
Using Volumes from the Host |
|
|
122 | (1) |
|
|
123 | (1) |
|
Write-Protecting a Bind Mount |
|
|
124 | (1) |
|
|
125 | (1) |
|
|
125 | (2) |
|
Storage Strategies for the Docker Host |
|
|
127 | (3) |
|
Attaching External Storage to a Docker Host |
|
|
128 | (2) |
|
|
130 | (3) |
|
Chapter 10 Configuring Container Networking |
|
|
133 | (12) |
|
Expose Ports to Other Containers |
|
|
134 | (2) |
|
Map Ports Outside the Host |
|
|
136 | (3) |
|
Map a Port from Linked Containers |
|
|
136 | (2) |
|
Connect Containers on Different Hosts |
|
|
138 | (1) |
|
Alternatives to the dockero Bridge |
|
|
139 | (3) |
|
Changing Network Mode for a Container |
|
|
140 | (1) |
|
Examining Network Options |
|
|
140 | (2) |
|
Changing the Docker Network Bridge |
|
|
142 | (1) |
|
|
143 | (2) |
|
Chapter 11 Cleaning Up Containers |
|
|
145 | (12) |
|
Making Space for Images and Containers |
|
|
146 | (1) |
|
|
146 | (4) |
|
Removing Individual Images |
|
|
147 | (1) |
|
|
148 | (2) |
|
|
150 | (3) |
|
Removing Individual Containers |
|
|
150 | (2) |
|
Removing Multiple Containers |
|
|
152 | (1) |
|
Cleaning Up and Saving Containers |
|
|
153 | (1) |
|
Cleaning Up and Saving an Ubuntu Container |
|
|
153 | (1) |
|
Cleaning Up and Saving a Fedora Container |
|
|
154 | (1) |
|
|
154 | (3) |
|
Chapter 12 Building Docker Images |
|
|
157 | (16) |
|
Doing a Simple docker build |
|
|
158 | (3) |
|
Setting a Command to Execute from a Dockerfile |
|
|
161 | (4) |
|
Using the CMD Instruction |
|
|
161 | (1) |
|
Using the ENTRYPOINT Instruction |
|
|
162 | (1) |
|
Using the RUN Instruction |
|
|
163 | (1) |
|
Adding Files to an Image from a Dockerfile |
|
|
164 | (1) |
|
Exposing Ports from an Image within a Dockerfile |
|
|
165 | (1) |
|
Assigning Environment Variables in a Dockerfile |
|
|
166 | (1) |
|
Assigning Labels in a Dockerfile |
|
|
167 | (1) |
|
Using Other docker build Command Options |
|
|
168 | (1) |
|
Tips for Building Containers |
|
|
169 | (2) |
|
|
169 | (1) |
|
Keep Build Directory Small |
|
|
169 | (1) |
|
|
170 | (1) |
|
Manage How Caching Is Done |
|
|
170 | (1) |
|
|
171 | (2) |
Part III Running Containers in Cloud Environments |
|
173 | (38) |
|
Chapter 13 Using Super Privileged Containers |
|
|
175 | (18) |
|
Using Super Privileged Containers in Atomic Host |
|
|
176 | (1) |
|
Understanding Super Privileged Containers |
|
|
176 | (4) |
|
Opening Privileges to the Host |
|
|
177 | (1) |
|
Accessing the Host Process Table |
|
|
177 | (1) |
|
Accessing Host Network Interfaces |
|
|
178 | (1) |
|
Accessing Host Inter-Process Communications |
|
|
179 | (1) |
|
Accessing Host File Systems |
|
|
179 | (1) |
|
Preparing to Use Super Privileged Containers |
|
|
180 | (1) |
|
|
180 | (5) |
|
Installing an SPC Image with atomic |
|
|
182 | (1) |
|
Getting Information about an SPC Image with atomic |
|
|
182 | (1) |
|
Running an SPC Image with atomic |
|
|
183 | (1) |
|
Stopping and Restarting an SPC with atomic |
|
|
184 | (1) |
|
|
184 | (1) |
|
Uninstalling an SPC Image |
|
|
185 | (1) |
|
|
185 | (6) |
|
Running the RHEL Tools SPC |
|
|
186 | (1) |
|
Running the Logging (rsyslog) SPC |
|
|
187 | (2) |
|
Running the System Monitor (sadc) SPC |
|
|
189 | (2) |
|
|
191 | (2) |
|
Chapter 14 Managing Containers in the Cloud with Cockpit |
|
|
193 | (18) |
|
|
194 | (4) |
|
|
198 | (1) |
|
Adding Servers into Cockpit |
|
|
199 | (2) |
|
Working with Containers from Cockpit |
|
|
201 | (3) |
|
Adding Container Images to Cockpit |
|
|
201 | (1) |
|
Running Images from Cockpit |
|
|
201 | (3) |
|
Working with Network Interfaces from Cockpit |
|
|
204 | (3) |
|
Configuring Storage from Cockpit |
|
|
207 | (1) |
|
Doing Other Administrative Tasks in Cockpit |
|
|
208 | (2) |
|
Managing Administrator Accounts in Cockpit |
|
|
208 | (1) |
|
Open a Terminal in Cockpit |
|
|
209 | (1) |
|
|
210 | (1) |
Part IV Managing Multiple Containers |
|
211 | (28) |
|
Chapter 15 Orchestrating Containers with Kubernetes |
|
|
213 | (12) |
|
|
214 | (2) |
|
|
216 | (2) |
|
Setting Up an All-in-One Kubernetes Configuration |
|
|
218 | (6) |
|
Installing and Starting Up Kubernetes |
|
|
218 | (2) |
|
Starting Up a Pod in Kubernetes |
|
|
220 | (3) |
|
|
223 | (1) |
|
|
224 | (1) |
|
Chapter 16 Creating a Kubernetes Cluster |
|
|
225 | (14) |
|
Understanding Advanced Kubernetes Features |
|
|
226 | (1) |
|
Setting Up a Kubernetes Cluster |
|
|
226 | (7) |
|
|
227 | (1) |
|
Step 2: Set Up Kubernetes Master |
|
|
227 | (3) |
|
Step 3: Set Up Kubernetes Nodes |
|
|
230 | (1) |
|
Step 4: Set Up Networking with Flannel |
|
|
231 | (2) |
|
Starting Up Pods in a Kubernetes Cluster |
|
|
233 | (4) |
|
Deleting Replication Controllers, Services, and Pods |
|
|
237 | (1) |
|
|
238 | (1) |
Part V Developing Containers |
|
239 | (34) |
|
Chapter 17 Developing Docker Containers |
|
|
241 | (12) |
|
Setting Up for Container Development |
|
|
241 | (6) |
|
Choosing a Container Development Environment for Red Hat Systems |
|
|
242 | (4) |
|
Container Development Environments from Docker |
|
|
246 | (1) |
|
Using Good Development Practices |
|
|
247 | (5) |
|
Gathering or Excluding Files for a Build |
|
|
248 | (1) |
|
Taking Advantage of Layers |
|
|
249 | (1) |
|
Managing Software Packages in a Build |
|
|
250 | (1) |
|
Learning More about Building Containers |
|
|
251 | (1) |
|
|
252 | (1) |
|
Chapter 18 Exploring Sample Dockerfile Files |
|
|
253 | (20) |
|
Examining Dockerfiles for Official Docker Images |
|
|
254 | (4) |
|
Viewing a CentOS Dockerfile |
|
|
254 | (3) |
|
Viewing a Busybox Dockerfile |
|
|
257 | (1) |
|
Examining Dockerfiles from Open Source Projects |
|
|
258 | (5) |
|
Viewing a Word Press Dockerfile |
|
|
258 | (2) |
|
Viewing the MySQL Dockerfile |
|
|
260 | (3) |
|
Examining Dockerfiles for Desktop and Personal Use |
|
|
263 | (7) |
|
Viewing a Chrome Dockerfile |
|
|
263 | (4) |
|
Viewing a Firefox Dockerfile |
|
|
267 | (3) |
|
|
270 | (3) |
Index |
|
273 | |