Podman: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
No edit summary
Line 7: Line 7:
== Display the log of the container ==
== Display the log of the container ==
* {{ kbd | key=<nowiki>docker logs [OPTIONS] CONTAINER</nowiki>}} <ref>[https://docs.docker.com/engine/reference/commandline/logs/ docker logs | Docker Documentation]</ref>
* {{ kbd | key=<nowiki>docker logs [OPTIONS] CONTAINER</nowiki>}} <ref>[https://docs.docker.com/engine/reference/commandline/logs/ docker logs | Docker Documentation]</ref>
* {{ kbd | key=<nowiki>podman logs [options] container [container…]</nowiki>}} e.g {{ kbd | key=<nowiki>podman logs <ID_OR_NAME></nowiki>}} <ref>[https://docs.podman.io/en/latest/markdown/podman-logs.1.html podman-logs — Podman documentation]</ref>
* {{ kbd | key=<nowiki>podman logs [options] container [container…]</nowiki>}} e.g {{ kbd | key=<nowiki>podman logs <CONTAINER_ID_OR_NAME></nowiki>}} <ref>[https://docs.podman.io/en/latest/markdown/podman-logs.1.html podman-logs — Podman documentation]</ref>


== List the images ==
== List the images ==

Revision as of 16:35, 22 August 2022

"Podman is a daemonless container engine for developing, managing, and running OCI Containers on your Linux System." (Cited from Podman)

Build an image from a Dockerfile

  • docker build [OPTIONS] PATH | URL | - [1]
  • podman build [options] [context] e.g. podman build -f ./Dockerfile [2]

Display the log of the container

  • docker logs [OPTIONS] CONTAINER [3]
  • podman logs [options] container [container…] e.g podman logs <CONTAINER_ID_OR_NAME> [4]

List the images

  • docker image ls [OPTIONS] [REPOSITORY[:TAG]] [5]
  • podman images [options] [image] [6]

List the containers

List running containers

  • docker container ls [OPTIONS] [7]
  • podman ps [8]

List all containers

  • docker container ls -a
  • podman ps -a

Start the container from image

  • docker run [OPTIONS] IMAGE [COMMAND] [ARG...] [9]
  • podman run [options] image [command [arg …]] e.g. podman run --name <CONTAINER_NAME> <IMAGE_ID> [10]

References