Skip to content

Latest commit

 

History

History
122 lines (84 loc) · 3.22 KB

podman.md

File metadata and controls

122 lines (84 loc) · 3.22 KB

Podman

Description

Podman (the POD MANager) is a tool for managing containers and images, volumes mounted into those containers, and pods made from groups of containers.

Directory

References


Installation

Description

This details the installation and setup of Podman on Linux and macOS as an alternative to Docker.

References

Linux

Important

Ensure the path to ~/.local/bin is in your ${PATH} environment variable.

  1. Ensure you have /etc/subuid and /etc/subgid, if you don't, create the files:

    sudo touch /etc/subuid /etc/subgid

    and add a subuid and subgid:

    sudo usermod --add-subuid 100000-165535 --add-subgid 100000-165535 ${USER}
  2. Write a bash script that helps fetch and install the latest podman release:

    nano ~/get-podman-launcher.sh

    Add the following content to the get-podman-launcher.sh script:

    curl -Lo "${HOME}/podman-launcher-amd64" "https://github.com/89luca89/podman-launcher/releases/latest/download/podman-launcher-amd64"
    chmod +x "${HOME}/podman-launcher-amd64"
    mkdir -p "${HOME}/.local/bin"
    mv -f "${HOME}/podman-launcher-amd64" "${HOME}/.local/bin/podman"
  3. Install podman by running the script:

    bash ~/get-podman-launcher.sh

macOS

Important

A portion of this guide assumes you are using the Fish shell. If you are using a different shell, make any required adjustments accordingly.

  1. Install podman using Homebrew:

    brew install podman
  2. To then use Podman, since podman only runs on Linux, you will need to create and start a Podman machine (VM).

    Create a Podman machine (do this only once):

    podman machine init

    Start the Podman machine:

    podman machine start
  3. To automatically start the Podman machine each time you launch a shell session, add the following to your shell profile (i.e. ~/.config/fish/config.fish):

    # start podman machine if not running
    if status is-interactive
        # check if podman is installed
        if command -v podman >/dev/null
            # check if podman machine is running
            set machine_info (podman machine info)
            if ! string match -q "*machinestate: Running*" $machine_info
                # start podman machine quietly
                podman machine start >/dev/null 2>&1
            end
        end
    end

    Reload the shell profile (i.e. ~/.config/fish/config.fish) to apply the changes:

    source ~/.config/fish/config.fish

    This will start the default Podman machine if it is not already running.