Command line: Podman

Podman is a daemonless container engine. It was also designed to be a drop-in replacement for Docker with similar command-line interface and everything. Thus, it is also compatible with Docker images and configurations (i.e., Dockerfiles).

Configuring to include docker.io

By default, Podman focuses on making the user concious about multiple registries outside DockerHub. Thus, it doesn't have any by default. You have to configure it first. For more information, see the podman.1 manual page and the linked pages.

Here's an incredibly simple example configuration that includes DockerHub.

unqualified-search-registries = ['docker.io']

Subcommands

Podman has Git-style command-line interface with subcommands and exclusive options.

Examples

Podman is a big tool so it needs a big list of examples.

Quickstart for pushing a container

As with big tools, comes with a big quickstart.

# Builds an image from the Dockerfile of the current directory.
podman build --tag todo-list-web-app .

# List the images to see if our app image has been built.
podman image list

# Assuming the app creates an HTTP server at port 5000, we'll expose it to the host, making it accessible from there.
podman run -d -p 5111:5000 todo-list-web-app

# See if we did run a containerized version of our app.
podman container list

# Tag the image with the convention seen in Docker registry.
podman tag foodogsquared/python-helloworld:v1.0.0

# Push the image to the Docker registry (assuming you've already logged in to Docker registry).
podman push foodogsquared/python-helloworld

Interactive selection of removing images

What would be an example script without something like fzf?

podman image list --format "{{.ID}} {{.Repository}} {{.Tag}}" \
    | fzf --multi --prompt "Choose images to remove > " \
    | awk '{print $1}' \
    | xargs podman image rm

Interactive image search and install

Yes, another one with fzf...

podman image search --format "{{.Index}} {{.Name}}" alpine \
    | fzf --multi --prompt "Choose images to install > " \
    | awk '{print $2}' \
    | xargs podman image pull