podman
1.TH How to use libpod for custom/derivative projects
2.PP
3libpod today is a Golang library and a CLI. The choice of interface you make has advantages and disadvantages.
4
5.SH Running as a subprocess
6.PP
7Advantages:
8
9.RS
10.IP \(bu 2
11Many commands output JSON
12.IP \(bu 2
13Works with languages other than Golang
14.IP \(bu 2
15Easy to get started
16
17.RE
18
19.PP
20Disadvantages:
21
22.RS
23.IP \(bu 2
24Error handling is harder
25.IP \(bu 2
26May be slower
27.IP \(bu 2
28Can't hook into or control low\-level things like how images are pulled
29
30.RE
31
32.SH Vendoring into a Go project
33.PP
34Advantages:
35
36.RS
37.IP \(bu 2
38Significant power and control
39
40.RE
41
42.PP
43Disadvantages:
44
45.RS
46.IP \(bu 2
47You are now on the hook for container runtime security updates (partially, \fB\fCrunc\fR/\fB\fCcrun\fR are separate)
48.IP \(bu 2
49Binary size
50.IP \(bu 2
51Potential skew between multiple libpod versions operating on the same storage can cause problems
52
53.RE
54
55.SH Making the choice
56.PP
57A good question to ask first is: Do you want users to be able to use \fB\fCpodman\fR to manipulate the containers created by your project?
58If so, that makes it more likely that you want to run \fB\fCpodman\fR as a subprocess. If you want a separate image store and a fundamentally
59different experience; if what you're doing with containers is quite different from those created by the \fB\fCpodman\fR CLI,
60that may drive you towards vendoring.
61