===== Overview ===== Setting up and running ''podman'' on Fedora 30 (currently Branched): Libpod provides a library for applications looking to use the Container Pod concept, popularized by Kubernetes. Libpod also contains the Pod Manager tool (Podman). Podman manages pods, containers, container images, and container volumes. Some links:Source and package links: * [[https://podman.io|podman home page]] * [[https://github.com/containers/libpod|GitHub repo for libpod]] * [[https://apps.fedoraproject.org/packages/podman|Fedora podman package]] Tutorial links: * [[https://github.com/containers/libpod/blob/master/transfer.md|Podman Usage Transfer]] * [[https://www.projectatomic.io/blog/2018/02/reintroduction-podman/|Reintroduction of podman (Feb 2018)]] * [[https://developers.redhat.com/articles/podman-next-generation-linux-container-tools/|Podman - The next generation of Linux container tools]] * [[https://www.projectatomic.io/blog/2018/05/podman-tls/|Podman and insecure registries]] * [[https://developers.redhat.com/blog/2019/01/29/podman-kubernetes-yaml/|Podman can now ease the transition to Kubernetes and CRI-O]] * [[https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8-beta/html/building_running_and_managing_containers/container-command-line-reference_building-running-and-managing-containers|podman command-line reference]] * [[https://developers.redhat.com/blog/2019/02/21/podman-and-buildah-for-docker-users/|Podman and Buildah for Docker users]] Dan Walsh's opensource.com articles: * [[https://opensource.com/article/18/10/podman-more-secure-way-run-containers|Podman: A more secure way to run containers]] * [[https://opensource.com/article/18/12/podman-and-user-namespaces|Podman and user namespaces: A marriage made in heaven]] * [[https://opensource.com/article/19/2/how-does-rootless-podman-work|How does rootless Podman work?]] There should theoretically be no need for docker-related RPMs for any of this. ===== DESCRIPTION ===== Podman (Pod Manager) is a fully featured container engine that is a simple daemonless tool. Podman provides a Docker-CLI comparable command line that eases the transition from other container engines and allows the management of pods, containers and images. Simply put: alias docker=podman. Most Podman commands can be run as a regular user, without requiring additional privileges. Podman uses Buildah(1) internally to create container images. Both tools share image (not container) storage, hence each can use or manipulate images (but not containers) created by the other. ===== Necessary pre-configuration for podman ===== ==== sssd ==== If you have ''sssd'' installed and running and you aren't using it, you need to disable it. One approach is to simply: $ sudo dnf remove sssd sssd-common Alternatively, I suspect you could just disable it through ''systemd''. ==== Adding subuids and subgids ==== Discussed [[https://github.com/containers/libpod/blob/master/troubleshooting.md#10-podman-fails-to-run-in-user-namespace-because-etcsubuid-is-not-properly-populated|here]], you may need to manually add subuids and subgids for the account that will be running podman: $ sudo usermod --add-subuids 558752-624287 rpjday $ sudo usermod --add-subgids 558752-624287 rpjday ==== Testing the setup ==== Once the above is done, the following should just work: $ podman run hello-world Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/ $ ===== podman command list ===== ==== ASSORTED ==== * cp [DONE] * generate-kube * generate * login * logout * play-kube * play * search * tag * unmount * varlink * version [DONE] ==== container ==== * attach * checkpoint * cleanup * commit * create * diff * exec * exists * export * inspect * kill * logs * mount * pause * port * prune * ps [aka ls, list] * restart * restore * rm * run * runlabel * start * stats * stop * top * umount * unmount [aka umount] * unpause * wait ==== image ==== * build * exists * history * import * inspect * list * load * ls * prune * pull * push * rm * save * sign * tag * trust ==== pod ==== * create * exists * inspect * kill * pause * ps * restart * rm * start * stats * stop * top * unpause ==== system ==== * info * prune * renumber ==== volume ==== * create * inspect * ls * prune * rm ===== Informational commands ===== ==== version ==== Regular output: $ podman version Version: 1.1.2 RemoteAPI Version: 1 Go Version: go1.12 OS/Arch: linux/amd64 $ Using Go template: $ podman version --format '{{.Version}}' 1.1.2 $ JSON format: $ podman version --format json { "RemoteAPIVersion": 1, "Version": "1.1.2", "GoVersion": "go1.12", "GitCommit": "", "Built": 0, "OsArch": "linux/amd64" } $ ==== info ==== $ podman info $ podman info --debug $ podman info --format json $ podman info --format '{{.registries}}' map[registries:[docker.io registry.fedoraproject.org quay.io registry.access.redhat.com registry.centos.org]] Equivalent: $ podman system info ==== Listing containers/images ==== === images === $ podman images $ podman images [-a|--all] [include intermediate images] $ podman image [list|ls] === containers === $ podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES $ podman container ps -a [include non-running containers] ===== search ===== $ podman search hello-world $ podman search --limit 3 hello-world [limit from each registry] $ podman search docker.io/hello-world ===== inspect ===== $ docker inspect fedora:28 $ docker inspect --latest ===== cp ===== NAME podman-cp - Copy files/folders between a container and the local filesystem SYNOPSIS podman cp [CONTAINER:]SRC_PATH [CONTAINER:]DEST_PATH Start a Ubuntu container: $ podman run -it --rm ubuntu bash Identify it, and copy the file ''/etc/os-release'' to local ''/tmp'': $ podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES cb29f21de0df docker.io/library/ubuntu:latest bash 3 minutes ago Up 3 minutes ago pensive_lamport $ podman cp pensive_lamport:etc/os-release /tmp/os $ cat/tmp/os NAME="Ubuntu" VERSION="18.04.2 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.2 LTS" VERSION_ID="18.04" ... etc etc ... Copy from local filesystem to container: $ podman cp /etc/os-release pensive_lamport:tmp ===== Removing things ===== Remove containers: $ podman rm $ podman rm [-a|--all]