Podman

Updated: September 28, 2024

Podman is an daemonless docker and does a better job exposing the VM (machine)

Podman is similar to docker commands enough that they can be run in place. It has increased security, unique identifier (UID) separation using namespaces, and integration with systemd.


Table of Contents

Install

Podman Installs

Machine

# start a default machine | --now starts the VM
podman machine init --now

# create a machine with a name (development) and start it, only works during creation.
podman machine init --now development

# start a machine with set resources
podman machine init --cpus 4 --memmory 2048 --disk-size 100 --now

# start the default machine
podman machine start
podman machine start development      # eg

# if you need to run priveledges like binding common system ports <1024
podman machine set --rootful      # reset with --rootful=false

# stop the machine used by podman
podman machine stop
podman machine stop development     # eg

# removes all containers and images (must be stopped)
podman machine rm

# list all machines
podman machine list

# get details about a specific machine like developnment
podman machine inspect development

Connection

# set the connection to development
podman system connection default development

# if you can ssh... you can register a connection
podman system connection add someserver

Images

# list all local images
podman images

# remove image from local system only, not from teh remote registry
podman rmi -f image:tag
podman rmi -f c234h342344      # eg

# push image to remote registy
podman push registryURL/username/image:tag
podman push quay.io/butternuts/mynode:v1        # eg

# get historical information of container image
podman history [options] image:tag
podman history quay.io/butternuts/mynode:v1     #eg

# login to remote repository
podman login [options] registryURL
podman login quay.io

# logout from remote repository
podman logout registryURL

# pull image down from repository
podman pull [options] registryURL/username/image:tag


Run



SSH

# update wsl machine that is running ubuntu
podman machine ssh sudo apt update && sudo apt upgrade -y