Ubuntu 22.04
Sponsored Link

Podman : Install
2022/04/28
 
Install Podman that is Container management tool.
[1] Install Podman.
root@dlp:~#
apt -y install podman
[2] Download an official image and create a Container and output the words [Welcome to the Podman World] inside the Container.
# download the official image

root@dlp:~#
podman pull ubuntu

Resolved "ubuntu" as an alias (/etc/containers/registries.conf.d/shortnames.conf)
Trying to pull docker.io/library/ubuntu:latest...
Getting image source signatures
Copying blob 8527c5f86ecc done
Copying config 3f4714ee06 done
Writing manifest to image destination
Storing signatures
3f4714ee068a59a09d9e77de71ec1254e5916d6e5779140bc96cec7d0edea18d

# run echo inside a container

root@dlp:~#
podman run ubuntu /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 ubuntu /bin/bash

root@ab156f0bf085:/#    
# connected
root@ab156f0bf085:/#
uname -a

Linux ab156f0bf085 5.15.0-27-generic #28-Ubuntu SMP Thu Apr 14 04:55:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
root@ab156f0bf085:/#
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 ubuntu /bin/bash

f40dcf34cce96b5aef50215edf9925ee54b8f149cb68a1f944b293f83e7fd4b5

# show podman proceses

root@dlp:~#
podman ps

CONTAINER ID  IMAGE                            COMMAND     CREATED         STATUS             PORTS       NAMES
f40dcf34cce9  docker.io/library/ubuntu:latest  /bin/bash   10 seconds ago  Up 10 seconds ago              thirsty_almeida

# attach to container session

root@dlp:~#
podman exec -it f40dcf34cce9 /bin/bash

root@f40dcf34cce9:/#    
# connected

root@f40dcf34cce9:/#
exit
# stop container process
# * if force stop, specify [podman kill ***]

root@dlp:~#
podman stop f40dcf34cce9

root@dlp:~#
podman ps

CONTAINER ID  IMAGE   COMMAND  CREATED  STATUS  PORTS   NAMES
Matched Content