Podman: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
(Remove the container)
Line 21: Line 21:
* {{ kbd | key=<nowiki>docker container ls -a</nowiki>}}
* {{ kbd | key=<nowiki>docker container ls -a</nowiki>}}
* {{ kbd | key=podman ps -a}}
* {{ kbd | key=podman ps -a}}
== Remove the container ==
* {{ kbd | key=<nowiki>docker rm [OPTIONS] CONTAINER [CONTAINER...]</nowiki>}} e.g. {{ kbd | key=<nowiki>docker container rm <CONTAINER_ID></nowiki>}} <ref>[https://docs.docker.com/engine/reference/commandline/rm/ docker rm | Docker Documentation]</ref>
* {{ kbd | key=<nowiki>podman rm [options] container</nowiki>}} e.g. {{ kbd | key=<nowiki>podman rm <CONTAINER_ID></nowiki>}} <ref>[https://docs.podman.io/en/latest/markdown/podman-rm.1.html podman-rm — Podman documentation]</ref>


== Start the container from image ==
== Start the container from image ==
* {{ kbd | key=<nowiki>docker run [OPTIONS] IMAGE [COMMAND] [ARG...]</nowiki>}} <ref>[https://docs.docker.com/engine/reference/commandline/run/ docker run | Docker Documentation]</ref>
* {{ kbd | key=<nowiki>docker run [OPTIONS] IMAGE [COMMAND] [ARG...]</nowiki>}} <ref>[https://docs.docker.com/engine/reference/commandline/run/ docker run | Docker Documentation]</ref>
* {{ kbd | key=<nowiki>podman run [options] image [command [arg …]]</nowiki>}} e.g. {{ kbd | key=<nowiki>podman run --name <CONTAINER_NAME> <IMAGE_ID></nowiki>}} <ref>[https://docs.podman.io/en/latest/markdown/podman-run.1.html podman-run — Podman documentation]</ref>
* {{ kbd | key=<nowiki>podman run [options] image [command [arg …]]</nowiki>}} e.g. {{ kbd | key=<nowiki>podman run --name <CONTAINER_NAME> <IMAGE_ID></nowiki>}} <ref>[https://docs.podman.io/en/latest/markdown/podman-run.1.html podman-run — Podman documentation]</ref>


== References ==
== References ==

Revision as of 15:46, 23 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

Remove the container

  • docker rm [OPTIONS] CONTAINER [CONTAINER...] e.g. docker container rm <CONTAINER_ID> [9]
  • podman rm [options] container e.g. podman rm <CONTAINER_ID> [10]

Start the container from image

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


References