网页
综合
更新时间 2026-11-13 17:22:24
Getting Started with Podman | Podman
自动蜘蛛
podman.io
正文约 3873 字
Podman is a utility provided as part of the libpod library. It can be used to create and maintain containers. The following tutorial will teach you how to set up Podman and perform some basic commands.
The documentation for Podman is located here.
For installing or building Podman, please see the installation instructions.
The code samples are intended to be run as a non-root user, and use sudo where root escalation is required.
To get some help and find out how Podman is working, you can use the help:
For more details, you can review the manpages:
Please also reference the Podman Troubleshooting Guide to find known issues and tips on how to solve common configuration mistakes.
Podman can search for images on remote registries with some simple keywords.
You can also enhance your search with filters:
Downloading (Pulling) an image is easy, too.
After pulling some images, you can list all images, present on your machine.
Note: Podman searches in different registries. To make sure you're pulling the correct image, use the full image name (docker.io/library/httpd instead of httpd).
This sample container will run a very basic httpd server that serves only its index page.
Note: Because the container is being run in detached mode, represented by the -d in the podman run command, Podman will print the container ID after it has executed the command.
Note: We use port forwarding to be able to access the HTTP server. You need slirp4netns v0.3.0 or newer to use it.
The podman ps command is used to list created and running containers.
Note: To show all containers (created, exited, running, etc.), use the -a option with the podman ps command.
As you are able to see, the container does not have an IP Address assigned. The container is reachable via its published port on your local machine.
From another machine, you need to use the IP Address of the host, running the container.
Note: Instead of using curl, you can also point a browser to http://localhost:8080.
You can "inspect" a running container for metadata and details about itself. podman inspect will provide lots of useful information like environment variables, network settings or allocated resources.
Since, the container is running in rootless mode, no IP Address is assigned to the container.
Note: The -l is a convenience argument for latest container. Instead of this short argument, you can also use the container's ID, container's name or the long argument (--latest).
Note: If you are running a remote Podman client, including Mac and Windows (excluding WSL2) machines, the -l option is not available.
You can also use Podman to view the container's logs:
You can observe the httpd pid in the container with podman top.
You may stop the container:
You can check the status of one or more containers using the podman ps command. In this case, you should use the -a argument to list all containers.
Finally, you can remove the container:
You can verify the deletion of the container by running podman ps -a.
For a more detailed guide about Networking and DNS in containers, please see the network guide.
Checkpointing a container stops the container while writing the state of all processes in the container to disk. With this, a container can later be migrated and restored, running at exactly the same point in time as the checkpoint. For more details, see the checkpoint instructions.
For more information on how to setup and run the integration tests in your environment, checkout the Integration Tests README.md.
The documentation for the Podman Python SDK is located here.
For more information on Podman and its subcommands, checkout the asciiart demos on the README.md page.
Copyright © 2026 Podman Container Tools, a Series of LF Projects, LLC. Built with Docusaurus.
For website terms of use, trademark policy, and other project policies, please see the LF Projects policies page.
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。