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:
Tutorial links:
Dan Walsh's opensource.com articles:
There should theoretically be no need for docker-related RPMs for any of this.
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.
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
.
Discussed 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
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/ $
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" } $
$ 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
$ podman images $ podman images [-a|--all] [include intermediate images] $ podman image [list|ls]
$ podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES $ podman container ps -a [include non-running containers]
$ podman search hello-world $ podman search --limit 3 hello-world [limit from each registry] $ podman search docker.io/hello-world
$ docker inspect fedora:28 $ docker inspect --latest
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
Remove containers:
$ podman rm <ctrID> $ podman rm [-a|--all]