Ubuntu 22.04 コンテナー管理ツールPodman をインストールする

環境

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
# cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"

操作方法
1.Podman をインストールします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# apt -y install podman
# apt -y install podman
# apt -y install podman

2.Ubuntu 公式イメージファイルをダウンロードします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# podman pull ubuntu
# podman pull ubuntu
# podman pull ubuntu

3. コンテナーで echo を実行します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# podman run ubuntu /bin/echo "Study Podman"
Study Podman
# podman run ubuntu /bin/echo "Study Podman" Study Podman
# podman run ubuntu /bin/echo "Study Podman"
Study Podman

4.コンテナー環境の対話型シェルセッションに接続します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# podman run -it ubuntu /bin/bash
# uname -a
Linux b0fc2e6c837d 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
# exit
exit
# podman run -it ubuntu /bin/bash # uname -a Linux b0fc2e6c837d 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux # exit exit
# podman run -it ubuntu /bin/bash
# uname -a
Linux b0fc2e6c837d 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
# exit
exit

5.コンテナーをデーモンとして起動します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# podman run -itd ubuntu /bin/bash
# podman run -itd ubuntu /bin/bash
# podman run -itd ubuntu /bin/bash

podmanプロセスを表示します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1e9f256cf131 docker.io/library/ubuntu:latest /bin/bash About a minute ago Up About a minute ago epic_mccarthy
# podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1e9f256cf131 docker.io/library/ubuntu:latest /bin/bash About a minute ago Up About a minute ago epic_mccarthy
# podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1e9f256cf131 docker.io/library/ubuntu:latest /bin/bash About a minute ago Up About a minute ago epic_mccarthy

 

Ubuntu 22.04

Posted by arkgame