Preface |
|
xi | |
Acknowledgments |
|
xii | |
About this book |
|
xiii | |
About the author |
|
xvi | |
About the Cover Illustration |
|
xvii | |
|
|
1 | (86) |
|
1 Podman: A next-generation container engine |
|
|
3 | (24) |
|
1.1 About all these terms |
|
|
4 | (3) |
|
1.2 A brief overview of containers |
|
|
7 | (8) |
|
Container images: A new way to ship software |
|
|
9 | (2) |
|
Container images lead to microservices |
|
|
11 | (2) |
|
|
13 | (1) |
|
|
14 | (1) |
|
1.3 Why use Podman when you have Docker? |
|
|
15 | (11) |
|
Why have only one way to run containers? |
|
|
15 | (1) |
|
|
16 | (1) |
|
|
17 | (2) |
|
|
19 | (1) |
|
User-friendly command line |
|
|
19 | (2) |
|
|
21 | (1) |
|
|
21 | (1) |
|
|
22 | (1) |
|
|
23 | (2) |
|
|
25 | (1) |
|
|
25 | (1) |
|
|
26 | (1) |
|
1.4 When not to use Podman |
|
|
26 | (1) |
|
|
27 | (40) |
|
2.1 Working with containers |
|
|
28 | (13) |
|
|
28 | (2) |
|
Running the containerized application |
|
|
30 | (4) |
|
|
34 | (1) |
|
|
35 | (1) |
|
|
36 | (1) |
|
|
36 | (1) |
|
|
37 | (1) |
|
|
38 | (1) |
|
Creating an image from a container |
|
|
39 | (2) |
|
2.2 Working with container images |
|
|
41 | (19) |
|
Differences between a container and an image |
|
|
42 | (2) |
|
|
44 | (1) |
|
|
45 | (1) |
|
|
46 | (2) |
|
Podman login: Logging into a container registry |
|
|
48 | (2) |
|
|
50 | (3) |
|
|
53 | (2) |
|
|
55 | (3) |
|
|
58 | (1) |
|
|
59 | (1) |
|
|
60 | (7) |
|
Format of a Containerfile or Dockerfile |
|
|
61 | (3) |
|
Automating the building of our application |
|
|
64 | (3) |
|
|
67 | (9) |
|
3.1 Using volumes with containers |
|
|
68 | (8) |
|
|
70 | (2) |
|
|
72 | (3) |
|
Podman Run Mount Command Option |
|
|
75 | (1) |
|
|
76 | (11) |
|
|
76 | (3) |
|
|
79 | (1) |
|
4.3 Adding a container to a pod |
|
|
80 | (2) |
|
|
82 | (1) |
|
|
83 | (1) |
|
|
84 | (1) |
|
|
84 | (3) |
|
|
87 | (38) |
|
5 Customization and configuration files |
|
|
89 | (17) |
|
5.1 Configuration files for storage |
|
|
91 | (1) |
|
|
91 | (3) |
|
|
94 | (2) |
|
5.2 Configuration files for registries 96registries, conf |
|
|
96 | (10) |
|
5.3 Configuration files for engines |
|
|
100 | (4) |
|
5.4 System configuration files |
|
|
104 | (2) |
|
|
106 | (19) |
|
6.1 How does rootless Podman work? |
|
|
109 | (1) |
|
Images contain content owned by multiple user identifiers (UIDs) |
|
|
110 | (8) |
|
6.2 Rootless Podman under the covers |
|
|
118 | (1) |
|
|
119 | (1) |
|
|
120 | (1) |
|
|
120 | (1) |
|
Starting the container monitor: conmon |
|
|
121 | (1) |
|
Launching the OCI runtime |
|
|
121 | (3) |
|
The containerized application runs until completion |
|
|
124 | (1) |
|
|
125 | (62) |
|
7 Integration with systemd |
|
|
127 | (24) |
|
7.1 Running systemd within a container |
|
|
128 | (6) |
|
Containerized systemd requirements |
|
|
131 | (1) |
|
Podman container in systemd mode |
|
|
131 | (1) |
|
Running an Apache service within a systemd container |
|
|
132 | (2) |
|
7.2 Journald for logging and events |
|
|
134 | (3) |
|
|
135 | (1) |
|
|
136 | (1) |
|
7.3 Starting containers at boot |
|
|
137 | (8) |
|
|
137 | (1) |
|
Podman containers as systemd services |
|
|
138 | (3) |
|
Distributing systemd unit files to manage Podman containers |
|
|
141 | (1) |
|
Automatically updating Podman containers |
|
|
142 | (3) |
|
7.4 Running containers in notify unit files |
|
|
145 | (2) |
|
7.5 Rolling back failed containers after update |
|
|
147 | (1) |
|
7.6 Socket-activated Podman containers |
|
|
147 | (4) |
|
8 Working with Kubernetes |
|
|
151 | (15) |
|
8.1 Kubernetes YAML files |
|
|
153 | (1) |
|
8.2 Generating Kubernetes YAML files with Podman |
|
|
153 | (4) |
|
8.3 Generating Podman pods and containers from Kubernetes YAML |
|
|
157 | (5) |
|
Shutting down pods and containers based on a Kubernetes YAML file |
|
|
158 | (1) |
|
Building images using Podman and Kubernetes YAML files |
|
|
159 | (3) |
|
8.4 Running Podman within a container |
|
|
162 | (4) |
|
Running Podman within a Podman container |
|
|
163 | (1) |
|
Running Podman within a Kubernetes pod |
|
|
164 | (2) |
|
|
166 | (21) |
|
9.1 Introducing the Podman service |
|
|
167 | (4) |
|
|
168 | (3) |
|
9.2 Podman-supported APIs |
|
|
171 | (2) |
|
9.3 Python libraries for interacting with Podman |
|
|
173 | (4) |
|
Using docker-py with the Podman API |
|
|
174 | (1) |
|
Using podman-py with the Podman API |
|
|
175 | (1) |
|
Which Python library should you use? |
|
|
176 | (1) |
|
9.4 Using docker-compose with the Podman service |
|
|
177 | (3) |
|
9.5 Podman Remote Local Connections |
|
|
180 | (7) |
|
|
182 | (2) |
|
Setting up SSH on the client machine |
|
|
184 | (1) |
|
|
185 | (2) |
|
PART 4 Container security |
|
|
187 | (45) |
|
10 Security container isolation |
|
|
189 | (27) |
|
10.1 Read-only Linux kernel pseudo filesystems |
|
|
191 | (3) |
|
Unmasking the masked paths |
|
|
192 | (1) |
|
|
193 | (1) |
|
|
194 | (4) |
|
Dropped Linux capabilities |
|
|
195 | (1) |
|
|
196 | (1) |
|
|
197 | (1) |
|
|
197 | (1) |
|
|
198 | (1) |
|
Root with no capabilities is still dangerous |
|
|
198 | (1) |
|
10.3 UID isolation: User namespace |
|
|
198 | (6) |
|
Isolating containers using the --userns=auto flag |
|
|
199 | (2) |
|
User-namespaced Linux capabilities |
|
|
201 | (1) |
|
Rootless Podman with the --userns=auto flag |
|
|
202 | (1) |
|
User volumes with the --usems=auto flag |
|
|
202 | (2) |
|
10.4 Process isolation: PID namespace |
|
|
204 | (1) |
|
10.5 Network isolation: Network namespace |
|
|
205 | (1) |
|
10.6 IPC isolation: IPC namespace |
|
|
206 | (1) |
|
10.7 Filesystem isolation: Mount namespace |
|
|
206 | (1) |
|
10.8 Filesystem isolation: SELinux |
|
|
207 | (6) |
|
|
207 | (4) |
|
SELinux Multi-Category Security separation |
|
|
211 | (2) |
|
10.9 System call isolation seccomp |
|
|
213 | (1) |
|
10.10 Virtual machine isolation |
|
|
214 | (2) |
|
11 Additional security considerations |
|
|
216 | (16) |
|
11.1 Daemon versus the fork/exec model |
|
|
217 | (3) |
|
Access to the docker.sock |
|
|
217 | (1) |
|
|
218 | (2) |
|
11.2 Podman secret handling |
|
|
220 | (1) |
|
|
221 | (7) |
|
|
224 | (4) |
|
11.4 Podman image scanning |
|
|
228 | (1) |
|
|
229 | (1) |
|
|
229 | (3) |
|
Podman uses all security mechanisms simultaneously |
|
|
230 | (1) |
|
Where should you run your containers? |
|
|
230 | (2) |
Appendix A Podman-related container tools |
|
232 | (14) |
Appendix B OCI runtimes |
|
246 | (8) |
Appendix C Getting Podman |
|
254 | (5) |
Appendix D Contributing to Podman |
|
259 | (3) |
Appendix E Podman on macOS |
|
262 | (7) |
Appendix F Podman on Windows |
|
269 | (12) |
Index |
|
281 | |