Skip to content

Instantly share code, notes, and snippets.

@erangaeb
Created April 25, 2023 03:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save erangaeb/c030ed2d6ffdbee5ab3cd95150048049 to your computer and use it in GitHub Desktop.
Save erangaeb/c030ed2d6ffdbee5ab3cd95150048049 to your computer and use it in GitHub Desktop.
install podman
# install podman
❯❯ brew install podman
# initializes a new Linux runtime envirounment which known as podman machine
# podman behind the scene uses quem emulator to provide linux runtem envirounment
# --cpus 4 (specify cpus)
# --memory=6144 (specify memory)
❯❯ podman machine init --cpus 4 --memory=6144
# list podman machines
# the default podman machine is `podman-machine-default*`
❯❯ podman machine ls
NAME VM TYPE CREATED LAST UP CPUS MEMORY DISK SIZE
podman-machine-default* qemu 4 days ago 4 days ago 2 2.147GB 107.4GB
# start runtime
# podman use volume mapping on /Users, /private, /var/folders directories
❯❯ podman machine start
Starting machine "podman-machine-default"
Waiting for VM ...
Mounting volume... /Users:/Users
Mounting volume... /private:/private
Mounting volume... /var/folders:/var/folders
This machine is currently configured in rootless mode. If your containers
require root permissions (e.g. ports < 1024), or if you run into compatibility
issues with non-podman clients, you can switch using the following command:
podman machine set --rootful
API forwarding listening on: /Users/lambda.eranga/.local/share/containers/podman/machine/podman-machine-default/podman.sock
The system helper service is not installed; the default Docker API socket
address can`t be used by podman. If you would like to install it run the
following commands:
sudo /opt/homebrew/Cellar/podman/4.4.2/bin/podman-mac-helper install
podman machine stop; podman machine start
You can still connect Docker API clients by setting DOCKER_HOST using the
following command in your terminal session:
export DOCKER_HOST='unix:///Users/lambda.eranga/.local/share/containers/podman/machine/podman-machine-default/podman.sock'
Machine "podman-machine-default" started successfully
podman machine start
# we need to have rootful podman
❯❯ podman machine set --rootful
# now podman machine is running
❯❯ podman machine ls
NAME VM TYPE CREATED LAST UP CPUS MEMORY DISK SIZE
podman-machine-default* qemu 4 days ago Currently running 2 2.147GB 107.4GB
# view info
❯❯ podman info
# podman connections
❯❯ podman system connection ls
Name URI Identity Default
podman-machine-default ssh://core@localhost:50985/run/user/501/podman/podman.sock /Users/lambda.eranga/.ssh/podman-machine-default true
podman-machine-default-root ssh://root@localhost:50985/run/podman/podman.sock /Users/lambda.eranga/.ssh/podman-machine-default false
# stop machine
❯❯ podman machine stop
# restart machine
❯❯ podman machine stop; podman machine start
# ssh to podman machine
❯❯ podman machine ssh
# remove machine
❯❯ podman machine rm -f podman-machine-default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment