Podman(Pod Manager)是一個功能齊全的容器引擎,它是一個簡單的無守護工具。 Podman提供了一個類似Docker-CLI的命令行,可以簡化從其他容器引擎的轉換,並允許管理pod,容器和圖像。 簡單地說:alias docker = podman。 大多數Podman命令可以作為普通用戶運行,而無需額外的權限。
Podman在內部使用Buildah(1)來創建容器圖像。 兩個工具共享圖像(而不是容器)存儲,因此每個工具可以使用或操縱由另一個創建的圖像(但不能操縱容器)。
GLOBAL OPTIONS
-help,-h
打印使用說明
--cgroup管理
CGroup管理用於容器cgroups。支持的值為cgroupfs或systemd(默認值)。設置此標志可能會導致某些命令在其他CGroup管理器類型創建的容器上調用時中斷。
--cpu-profile
寫入cpu性能結果的文件路徑
--hooks-DIR =路徑
路徑中的每個* .json文件都為Podman容器配置一個鈎子。有關JSON文件語法和鈎子注入語義的更多詳細信息,請參閱
oci-hooks(5)。 Podman和libpod目前同時支持1.0.0和0.1.0鈎子模式,不推薦使用0.1.0模式。此選項可以設置多次;來自后面選項的路徑具有更高的優先級(oci-hooks(5)討論目錄優先級)。對於注釋條件,libpod使用在生成的OCI配置中設置的任何注釋。對於綁定裝載條件,僅考慮通過--volume由調用方顯式請求的裝入。默認情況下綁定libpod插入的掛載(例如/ dev / shm)不被考慮。如果未為root調用者設置--hooks-dir,則Podman和libpod將按優先級遞增的順序默認為/usr/share/containers/oci/hooks.d和/etc/containers/oci/hooks.d。不推薦使用這些默認值,調用者應該遷移到顯式設置--hooks-dir。Podman和libpod目前支持額外的precreate狀態,該狀態在運行時的創建操作之前調用。與在標准輸入上接收容器狀態的其他階段不同,預創建掛鈎在其標准輸入上接收建議的運行時配置。他們可能會根據自己的需要更改配置,並將更改后的表單寫入其標准輸出。
警告:precreate hook允許執行強大的操作,例如向運行時配置添加其他安裝。這種力量也很容易打破局面。在報告libpod錯誤之前,請嘗試在禁用precreate掛鈎的情況下運行容器,以查看問題是否是由於其中一個掛鈎引起的。
--log-level
記錄指定級別以上的消息:debug,info,warn,error(默認),致命或恐慌(fatal or panic)
--namespace
設置libpod命名空間。命名空間用於在libpod的狀態下分隔容器和pod的組。設置名稱空間后,創建的容器和窗格將加入給定的名稱空間,並且只有給定名稱空間中的容器和窗格對Podman可見。
--root =
value
存儲根目錄,其中存儲數據(包括圖像)(對於UID 0,默認為“/ var / lib / containers / storage”,對於其他用戶,為“$ HOME / .local / share / containers / storage”)。默認根目錄在/etc/containers/storage.conf中配置。
--runroot =
value
存儲所有狀態信息的存儲狀態目錄(對於UID 0,默認為“/ var / run / containers / storage”,對於其他用戶,為“/ var / run / user / $ UID / run”)。默認狀態dir在/etc/containers/storage.conf中配置。
--runtime =
value
libpod.conf中指定的OCI運行時的名稱或用於運行容器的OCI兼容二進制文件的絕對路徑。
--network-cmd-path = path用於設置網絡的命令二進制文件的路徑。它目前僅用於設置slirp4netns網絡。如果使用“”,則使用$ PATH環境變量查找二進制文件。
-
-storage-driver
=
value
存儲驅動程序UID 0的默認存儲驅動程序在/etc/containers/storage.conf(無根模式下的$ HOME / .config / containers / storage.conf)中配置,當fuse-overlayfs不可用時,非root用戶的vfs是vfs 。 STORAGE_DRIVER環境變量會覆蓋默認值。 --storage-driver指定的驅動程序會覆蓋所有驅動程序。
覆蓋此選項將導致忽略/etc/containers/storage.conf中的storage-opt設置。用戶必須通過--storage-opt標志指定其他選項。
--storage-OPT =
value
存儲驅動程序選項,默認存儲驅動程序選項在/etc/containers/storage.conf中配置($ root / .config / containers / storage.conf以無根模式)。 STORAGE_OPTS環境變量會覆蓋默認值。 --storage-opt指定的選項會覆蓋所有選項。
--syslog
將日志記錄信息輸出到syslog以及控制台
--version,-v
打印版本
Exit Status
Command | Description |
---|---|
podman-attach(1) | Attach to a running container. |
podman-build(1) | Build a container image using a Dockerfile. |
podman-commit(1) | Create new image based on the changed container. |
podman-container(1) | Manage containers. |
podman-cp(1) | Copy files/folders between a container and the local filesystem. |
podman-create(1) | Create a new container. |
podman-diff(1) | Inspect changes on a container or image's filesystem. |
podman-events(1) | Monitor Podman events |
podman-exec(1) | Execute a command in a running container. |
podman-export(1) | Export a container's filesystem contents as a tar archive. |
podman-generate(1) | Generate structured data based for a containers and pods. |
podman-healthcheck(1) | Manage healthchecks for containers |
podman-history(1) | Show the history of an image. |
podman-image(1) | Manage images. |
podman-images(1) | List images in local storage. |
podman-import(1) | Import a tarball and save it as a filesystem image. |
podman-info(1) | Displays Podman related system information. |
podman-init(1) | Initialize a container |
podman-inspect(1) | Display a container or image's configuration. |
podman-kill(1) | Kill the main process in one or more containers. |
podman-load(1) | Load an image from a container image archive into container storage. |
podman-login(1) | Login to a container registry. |
podman-logout(1) | Logout of a container registry. |
podman-logs(1) | Display the logs of a container. |
podman-mount(1) | Mount a working container's root filesystem. |
podman-pause(1) | Pause one or more containers. |
podman-play(1) | Play pods and containers based on a structured input file. |
podman-pod(1) | Management tool for groups of containers, called pods. |
podman-port(1) | List port mappings for a container. |
podman-ps(1) | Prints out information about containers. |
podman-pull(1) | Pull an image from a registry. |
podman-push(1) | Push an image from local storage to elsewhere. |
podman-restart(1) | Restart one or more containers. |
podman-rm(1) | Remove one or more containers. |
podman-rmi(1) | Removes one or more locally stored images. |
podman-run(1) | Run a command in a new container. |
podman-save(1) | Save an image to a container archive. |
podman-search(1) | Search a registry for an image. |
podman-start(1) | Start one or more containers. |
podman-stats(1) | Display a live stream of one or more container's resource usage statistics. |
podman-stop(1) | Stop one or more running containers. |
podman-system(1) | Manage podman. |
podman-tag(1) | Add an additional name to a local image. |
podman-top(1) | Display the running processes of a container. |
podman-umount(1) | Unmount a working container's root filesystem. |
podman-unpause(1) | Unpause one or more containers. |
podman-unshare(1) | Run a command inside of a modified user namespace. |
podman-version(1) | Runs the varlink backend interface. |
podman-varlink(1) | Display the Podman version information. |
podman-volume(1) | Manage Volumes. |
podman-wait(1) | Wait on one or more containers to stop and print their exit co |
FILES
libpod.conf (/usr/share/containers/libpod.conf)
libpod.conf是使用libpod管理容器的所有工具的配置文件,以root用戶身份運行。 管理員可以通過創建`/ etc / containers / libpod.conf`來覆蓋默認文件。 當Podman以無根模式運行時,會創建文件`$ HOME / .config / containers / libpod.conf`並替換系統配置文件中的某些字段。
如果未找到libpod.conf文件,Podman將使用內置默認值。
mounts.conf (/usr/share/containers/mounts.conf)
mounts.conf文件指定在執行`podman run`或`podman start`命令時自動掛載在容器內的卷裝入目錄。 管理員可以通過創建`/ etc / containers / mounts.conf`來覆蓋默認文件。
當Podman以無根模式運行時,文件$ HOME / .config / containers / mounts.conf將覆蓋默認值(如果存在)。 有關更多詳細信息,請參閱containers mounts.conf(5)。
policy.json(/etc/containers/policy.json)
簽名驗證策略文件用於指定策略,例如, 可信密鑰,在決定是否接受圖像或該圖像的單個簽名時適用,有效。
registries.conf(/etc/containers/registries.conf)
registries.conf是配置文件,它指定在完成不包含注冊表或域部分的映像名稱時應查詢哪些容器注冊表。
Podman的非root用戶可以創建要使用的`$ HOME / .config / containers / registries.conf`文件而不是系統默認值。
storage.conf(/etc/containers/storage.conf)
storage.conf是使用容器/存儲的所有工具的存儲配置文件
存儲配置文件為使用共享容器存儲的工具指定所有可用容器存儲選項。
當Podman以無根模式運行時,使用文件`$ HOME / .config / containers / storage.conf`而不是系統默認值。
無根模式(
Rootless mode
)
Podman也可以用作非root用戶。當podman以無根模式運行時,將自動為用戶創建用戶命名空間,在/ etc / subuid和/ etc / subgid中定義。
非root用戶創建的容器對其他用戶不可見,並且不會被以root身份運行的podman看到或管理。
需要為用戶設置多個uid / gids。確保用戶出現在文件/ etc / subuid和/ etc / subgid中。
如果您有最新版本的usermod,則可以執行以下命令將范圍添加到文件中
$ sudo usermod --add-subuids 10000-75535 USERNAME
$ sudo usermod --add-subgids 10000-75535 USERNAME
或者只是手動添加內容。
$ echo USERNAME:10000:65536 >> / etc / subuid
$ echo USERNAME:10000:65536 >> / etc / subgid
有關更多信息,請參見subuid(5)和subgid(5)手冊頁。
指定時,圖像在XDG_DATA_HOME下拉,否則在.local / share / containers / storage下的用戶的主目錄中。
目前,需要安裝slirp4netns軟件包來創建網絡設備,否則無根容器需要在主機的網絡命名空間中運行。
也可以看看
containers-mounts.conf(5),containers-registries.conf(5),containers-storage.conf(5),buildah(1),libpod.conf(5),oci-hooks(5),policy.json( 5),subuid(5),subgid(5),slirp4netns(1)