Skip to content

Instantly share code, notes, and snippets.

@azzlack
Created January 18, 2024 12:49
Show Gist options
  • Save azzlack/1a0487dd8b2ac3faa3689b4bfcedff2d to your computer and use it in GitHub Desktop.
Save azzlack/1a0487dd8b2ac3faa3689b4bfcedff2d to your computer and use it in GitHub Desktop.
Install Podman on M1 Mac

Steps

  1. Download and install podman from https://github.com/containers/podman/releases. Remember to use the arm verison.

  2. Configure OSX machine provider config to use apple's hypervisor

    mkdir -p ~/.config/containers
    tee ~/.config/containers/containers.conf 1> /dev/null <<EOF
    [containers]
    
    [engine]
    
    [machine]
      provider = "applehv"
    
    [network]
    
    [secrets]
    
    [configmaps]
    
    [farms]
    EOF
  3. Install a required helper to allow podman to utilize the applehv machine provider

    brew tap cfergeau/crc
    brew install vfkit
  4. Initialize podman: podman machine init --cpus 5 --memory 6144

  5. Install podman mac helper: sudo podman-mac-helper install

  6. Create a dummy docker file for compatibility

    sudo tee /usr/local/bin/docker 1> /dev/null <<EOF
    #!/usr/bin/env bash
    [ -e /etc/containers/nodocker ] ||
    echo "Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg." >&2
    exec podman "\$@"
    EOF
    sudo chmod +x /usr/local/bin/docker
  7. Install Docker Compose

    2>/dev/null 1>/dev/null brew install docker-compose
    mkdir -p ~/.docker/cli-plugins
    ln -sfn /opt/homebrew/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose
  8. Start podman: podman machine start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment