Fedora 39
Sponsored Link

Podman : Install2023/11/16

 
Install Podman that is the Container management tool.
It's possible to use the same ease of use of Docker Cli and also Podman does not need specific Service Daemon.
[1] Install Podman.
[root@dlp ~]#
dnf -y install podman
[2] Download an official image and create a Container, next output the words [Welcome to the Podman World] inside the Container.
# download the official image

[root@dlp ~]#
podman pull fedora

Resolved "fedora" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull registry.fedoraproject.org/fedora:latest...
Getting image source signatures
Copying blob 6eb636413202 done   |
Copying config ec546109f8 done   |
Writing manifest to image destination
ec546109f8227b6cca3212bad13f50f3f3555455f51f0162776a43f160f60343

# run echo inside a container

[root@dlp ~]#
podman run fedora /bin/echo "Welcome to the Podman World"

Welcome to the Podman World
[3] Connect to the interactive session of a Container with [i] and [t] option like follows.
If [exit] from the Container session, the process of a Container finishes.
[root@dlp ~]#
podman run -it fedora /bin/bash

[root@02dd9e04af54 /]#    
# connected
[root@02dd9e04af54 /]#
uname -a

Linux 02dd9e04af54 6.5.11-300.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 8 22:37:57 UTC 2023 x86_64 GNU/Linux
[root@02dd9e04af54 /]#
exit

exit
[root@dlp ~]#    
# come back
[4] If you'd like to run a Container as a Daemon, add [d] option.
[root@dlp ~]#
podman run -itd fedora /bin/bash

3162c8d0e81336871daf7164f3a3eb5366f22482100cb1f6090e258ed712c541

# show podman processes

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE                                     COMMAND     CREATED         STATUS         PORTS       NAMES
3162c8d0e813  registry.fedoraproject.org/fedora:latest  /bin/bash   17 seconds ago  Up 18 seconds              friendly_jackson

# attach to container session

[root@dlp ~]#
podman exec -it 3162c8d0e813 /bin/bash

[root@3162c8d0e813 /]#    
# connected

[root@3162c8d0e813 /]#
exit
# stop container process (if force stop, specify [kill])

[root@dlp ~]#
podman stop 3162c8d0e813

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE   COMMAND  CREATED  STATUS  PORTS   NAMES
Matched Content