# Intro to podman
- open standard based container implementation
- supports Linux, FreeBSD hosts
- uses real jails underneath
- extensive tooling and industry support
---
## People
- Doug Rabson (the design, the code)
- Dave Cottlehuber (the docs, the releases)
---
## How Does It Work?
- public container images
- fetched locally and cached
- build additional layered images on top of public ones
---
## Why Is It Good?
- industry standard tooling
- remote daemon (podman-as-a-service)
- very fast deploys
---
## Demo
```
# podman image ls -a
REPOSITORY TAG IMAGE ID CREATED SIZE
# podman pull ghcr.io/freebsd/freebsd-runtime:15.snap
Trying to pull ghcr.io/freebsd/freebsd-runtime:15.snap...
Getting image source signatures
Copying blob f908674559b2 done |
Copying config 8e0179bc78 done |
Writing manifest to image destination
8e0179bc7834f4158db99368e63d97e0557fef5f14c44a8545205f10369d2093
# podman image ls -a
REPOSITORY TAG IMAGE ID CREATED SIZE
ghcr.io/freebsd/freebsd-runtime 15.snap 8e0179bc7834 5 days ago 46.8 MB
```
---
## Custom Images
```Containerfile
FROM ghcr.io/freebsd/freebsd-notoolchain:15.snap
RUN env ASSUME_ALWAYS_YES=yes pkg bootstrap -r FreeBSD
RUN pkg update -r FreeBSD-ports
RUN pkg install -Uyr FreeBSD-ports lang/python3
RUN rm -rf /var/cache/pkg
entrypoint /usr/local/bin/python3 -m http.server
```
---
## Building the Layers
```
# podman build --no-hosts --dns 9.9.9.9 -t localhost/test .
root@akai /v/t/oci [3]# podman build --no-hosts --dns 9.9.9.9 -t localhost/test .
STEP 1/5: FROM ghcr.io/freebsd/freebsd-notoolchain:15.snap
STEP 2/5: RUN env ASSUME_ALWAYS_YES=yes pkg bootstrap -r FreeBSD
--> Using cache 56cd02b3f0e4366345b54cd37c9afeffc7d55767f3ef4dd8aa991d719b59ec93
--> 56cd02b3f0e4
STEP 3/5: RUN pkg update -r FreeBSD-ports
--> Using cache 946adda5aaab7985a3ba3b0e2ce505bb148c578f35540c65351f0d123cbaefd3
--> 946adda5aaab
STEP 4/5: RUN pkg install -yr FreeBSD-ports lang/python3
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
FreeBSD-ports is up to date.
Updating database digests format: . done
The following 7 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
gettext-runtime: 0.23.1 [FreeBSD-ports]
indexinfo: 0.3.1_1 [FreeBSD-ports]
libffi: 3.5.1 [FreeBSD-ports]
mpdecimal: 4.0.1 [FreeBSD-ports]
python3: 3_4 [FreeBSD-ports]
python311: 3.11.13_1 [FreeBSD-ports]
readline: 8.2.13_2 [FreeBSD-ports]
Number of packages to be installed: 7
...
--> ab5d301df986
STEP 5/5: entrypoint /usr/local/bin/python3 -m http.server
COMMIT localhost/test
--> 90609da0afb3
Successfully tagged localhost/test:latest
90609da0afb332559275afa55776f4add9ad6cd9525e21a3cc1dee96b5cb4d85
```
---
## Listing New Images
```
podman image ls -a
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/test latest 90609da0afb3 About a minute ago 594 MB
<none> <none> ab5d301df986 About a minute ago 594 MB
<none> <none> 946adda5aaab 2 minutes ago 327 MB
<none> <none> 8ca74878d01c 3 minutes ago 594 MB
<none> <none> 1102b08f342c 3 minutes ago 594 MB
<none> <none> 11e6cacff238 3 minutes ago 327 MB
<none> <none> e1333d2e9b16 3 minutes ago 327 MB
<none> <none> 361b99e8086e 4 minutes ago 256 MB
<none> <none> 56cd02b3f0e4 4 minutes ago 256 MB
ghcr.io/freebsd/freebsd-notoolchain 15.snap 01f7e36f6d8a 5 days ago 195 MB
ghcr.io/freebsd/freebsd-runtime 15.snap 8e0179bc7834 5 days ago 46.8 MB
```
---
## Using Volumes
```
# podman run -it --rm \
--env ASSUME_ALWAYS_YES=true \
--no-hosts --dns 9.9.9.9 \
--volume /usr/local/sbin/pkg-static:/bin/pkg-static \
--volume /var/cache/pkg \
ghcr.io/freebsd/freebsd-toolchain:15.snap
```