Podman Tips

This document contains basic tips for running Podman on Debian and macOS.

Debian

To use Podman rootless, setup fuse-overlayfs:

  1. Install fuse-overlayfs

    $ sudo apt-get install fuse-overlayfs
    
  2. Configure the current user to use rootless:

    $ cat <<EOF >> ~/.config/containers/storage.conf
    [storage]
      driver = "overlay"
    
    
    [storage.options.overlay]
    
    
      mount_program = "/usr/bin/fuse-overlayfs"
    EOF
    
  3. Completely reset the Podman storage to its default state:

    $ podman system reset
    
  4. Confirm the overlay is being used:

    $ podman info | grep graphDriverName
    

    This must be overlay. If it's vfs then the fuse filesystem is not being used in rootless mode and building images will be very slow.

See also: - rootless_tutorial - Podman run/build is painfully slow compared to docker

macOS

Install using MacPorts

$ sudo port install podman podman-compose
$ podman machine init
$ podman machine start
$ podman machine list

Fails to Start

Stop any failed QEMU processes, assuming QEMU is not being run for any other purpose :

$ ps -edf | grep -E 'qemu-system.*podman' | grep -v grep | \
  awk '{print $2}' | xargs -I{} kill -9 {}; podman machine stop

See https://podman-desktop.io/docs/troubleshooting/troubleshooting-podman-on-macos

There is an issue when running on Apple Silicon (arm64) where Qemu appears to fail to boot. This can be resolved by installing the afscompress port and decompressing /opt/local/share/qemu/edk2-aarch64-code.fd:

$ afscompress -l /opt/local/share/qemu/edk2-aarch64-code.fd
$ sudo afscompress -d /opt/local/share/qemu/edk2-aarch64-code.fd
$ afscompress -l /opt/local/share/qemu/edk2-aarch64-code.fd

No space left on device

Re-create the machine with more space:

$ podmand machine rm
$ podman machine init --help
$ podman machine init --disk-size=150

Podman Compose Fails to Find Executable

Error: exec: docker-compose : executable file not found in $PATH

The podman compose command is a thin wrapper to execute an external provider such as docker-compose or podmand-compose. See podman compose --help for more information.

If the command fails to find an executable, define compose_providers in the engine table of containers.conf e.g.:

[engine]
  compose_providers = [ "podman-compose" ]

Configuration

  1. Configure to use with a Docker repository:

    $ cat <<EOF >> ~/.config/containers/registries.conf
    unqualified-search-registries = ["docker.io"]
    EOF
    

Short Names

https://www.redhat.com/sysadmin/container-image-short-names

Resources

-- Frank Dean - 09 Sep 2023


Related Topics: DockerTips, InstallingMacPorts