2019-11-02 17:46:04 +00:00
|
|
|
# podman
|
|
|
|
|
|
|
|
> Simple management tool for pods, containers and images.
|
2021-05-20 21:13:41 +01:00
|
|
|
> Podman provides a Docker-CLI comparable command-line. Simply put: `alias docker=podman`.
|
2021-07-06 12:28:21 +01:00
|
|
|
> More information: <https://github.com/containers/podman/blob/main/commands-demo.md>.
|
2019-11-02 17:46:04 +00:00
|
|
|
|
|
|
|
- List all containers (both running and stopped):
|
|
|
|
|
|
|
|
`podman ps --all`
|
|
|
|
|
2022-10-16 07:37:59 +01:00
|
|
|
- Create a container from an image, with a custom name:
|
|
|
|
|
|
|
|
`podman run --name {{container_name}} {{image}}`
|
|
|
|
|
|
|
|
- Start or stop an existing container:
|
2019-11-02 17:46:04 +00:00
|
|
|
|
2022-10-16 07:37:59 +01:00
|
|
|
`podman {{start|stop}} {{container_name}}`
|
2019-11-02 17:46:04 +00:00
|
|
|
|
2022-10-16 07:37:59 +01:00
|
|
|
- Pull an image from a registry (defaults to Docker Hub):
|
2019-11-02 17:46:04 +00:00
|
|
|
|
2022-10-16 07:37:59 +01:00
|
|
|
`podman pull {{image}}`
|
2019-11-02 17:46:04 +00:00
|
|
|
|
2022-10-16 07:37:59 +01:00
|
|
|
- Display the list of already downloaded images:
|
2019-11-02 17:46:04 +00:00
|
|
|
|
2022-10-16 07:37:59 +01:00
|
|
|
`podman images`
|
2019-11-02 17:46:04 +00:00
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Open a shell inside an already running container:
|
2019-11-02 17:46:04 +00:00
|
|
|
|
|
|
|
`podman exec --interactive --tty {{container_name}} {{sh}}`
|
|
|
|
|
2022-10-16 07:37:59 +01:00
|
|
|
- Remove a stopped container:
|
2019-11-02 17:46:04 +00:00
|
|
|
|
2022-10-16 07:37:59 +01:00
|
|
|
`podman rm {{container_name}}`
|
2019-11-02 17:46:04 +00:00
|
|
|
|
|
|
|
- Display the logs of one or more containers and follow log output:
|
|
|
|
|
|
|
|
`podman logs --follow {{container_name}} {{container_id}}`
|