Podman: A start point

Basic concepts before start

  • Bare metal: Each app runs in a physical host with an Operating System, these apps need to share the same libraries and environment to run in the same host.
  • Virtualization: Each app runs in a virtual machine running. We can see an abstraction of physical hardware.
  • Containers: Each app runs in a container and this is an abstraction of the app layers.

Why replace Docker with Podman?

  • Daemonless: It does not require a daemon.
  • Rootless: It lets you run containers as a non-root user.
  • systemd: Podman runs containers with Systemd by default.
  • Kubernetes transition: Podman can generate YAML’s to move to Kubernetes.

Environment

Installation

  1. Install the package
[root@podman01 ~]# dnf install podman
[root@podman01 ~]# podman --version
podman version 2.0.5
registries = ['registry.access.redhat.com', 'registry.redhat.io', 'docker.io' , 'quay.io']
[root@podman01 ~]# sudo podman infohost:
arch: amd64
buildahVersion: 1.15.1
cgroupVersion: v1
conmon:
package: conmon-2.0.20-2.module+el8.3.0+8221+97165c3f.x86_64
path: /usr/bin/conmon
version: 'conmon version 2.0.20, commit: 77ce9fd1e61ea89bd6cdc621b07446dd9e80e5b6'
cpus: 2
distribution:
distribution: '"rhel"'
version: "8.3"
eventLogger: file
hostname: podman01.example.com
idMappings:
gidmap: null
uidmap: null
kernel: 4.18.0-240.el8.x86_64
linkmode: dynamic
memFree: 2501382144
memTotal: 3917524992
ociRuntime:
name: runc
package: runc-1.0.0-68.rc92.module+el8.3.0+8221+97165c3f.x86_64
path: /usr/bin/runc
version: 'runc version spec: 1.0.2-dev'
os: linux
remoteSocket:
path: /run/podman/podman.sock
rootless: false
slirp4netns:
executable: ""
package: ""
version: ""
swapFree: 2210394112
swapTotal: 2210394112
uptime: 49m 53.15s
registries:
search:
- registry.access.redhat.com
- registry.redhat.io
- docker.io
- quay.io
store:
configFile: /etc/containers/storage.conf
containerStore:
number: 0
paused: 0
running: 0
stopped: 0
graphDriverName: overlay
graphOptions:
overlay.mountopt: nodev,metacopy=on
graphRoot: /var/lib/containers/storage
graphStatus:
Backing Filesystem: xfs
Native Overlay Diff: "false"
Supports d_type: "true"
Using metacopy: "true"
imageStore:
number: 1
runRoot: /var/run/containers/storage
volumePath: /var/lib/containers/storage/volumes
version:
APIVersion: 1
Built: 1600877882
BuiltTime: Wed Sep 23 13:18:02 2020
GitCommit: ""
GoVersion: go1.14.7
OsArch: linux/amd64
Version: 2.0.5

Podman basic operations

[root@podman01 ~]# podman login quay.io
Username: fajlinuxblog
Password:!
[root@podman01 ~]# podman search apache
[root@podman01 ~]#  podman pull quay.io/bitnami/nginx
[root@podman01 ~]# podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
quay.io/bitnami/nginx latest 91f438133f9c 19 hours ago 93.4 MB
[root@podman01 ~]# sudo podman run -d --name web1 -p 8082:80 quay.io/bitnami/nginx
[root@podman01 ~]# sudo podman ps
[root@podman01 ~]# podman exec -it web1 /bin/bash 
bash-4.2$
[root@podman01 ~]# podman logs web1
nginx 19:51:09.05
nginx 19:51:09.05 Welcome to the Bitnami nginx container
nginx 19:51:09.05 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-nginx
nginx 19:51:09.05 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-nginx/issues
nginx 19:51:09.05
nginx 19:51:09.05 INFO ==> ** Starting NGINX setup **
nginx 19:51:09.06 INFO ==> Validating settings in NGINX_* env vars
nginx 19:51:09.07 INFO ==> Initializing NGINX
nginx 19:51:09.07 INFO ==> ** NGINX setup finished! **
nginx 19:51:09.08 INFO ==> ** Starting NGINX **

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store