docker-ssh-agent-forward icon indicating copy to clipboard operation
docker-ssh-agent-forward copied to clipboard

podman support please

Open AntonioSun opened this issue 1 year ago • 1 comments
trafficstars

podman is not support out of the box at the moment.

I'll see if I can make it work on my end...

AntonioSun avatar Jan 01 '24 16:01 AntonioSun

The only changes I made to make it (kind of) work with podman under Mac are:

sudo ln -vsf podman /opt/homebrew/bin/docker
sudo sed -i '/docker volume create/s/ --name//' /usr/local/bin/pinata-ssh-forward

So, in order to support podman, the only changes need are:

  • detect if podman instead of docker is available (and set $DOCKER accordingly),
  • if so, instead of calling docker volume create --name "${VOLUME_NAME}", call $DOCKER volume create "${VOLUME_NAME}"

That's it.

As for Mac, unlike Docker, mounting any local volumes in Podman on macOS requires an additional step of sharing the folder with the Podman VM before they can be mounted into a container, yet pinata-ssh-forward need a working Podman VM to run. I tried

podman machine init, then called pinata-ssh-forward successful, then tried to call podman machine init -v ssh-agent:/ssh-agent again, but got:

$ podman machine start
Starting machine "podman-machine-default"
Waiting for VM ...
Error: qemu exited unexpectedly with exit code 1, stderr: qemu-system-aarch64: -virtfs local,path=ssh-agent,mount_tag=vol6,security_model=none: cannot initialize fsdev 'vol6': failed to open 'ssh-agent': No such file or directory

Hope there is a way to circumvent the chicken-egg dilemma somehow (like making the ssh-agent thing a local folder or something). thx.

AntonioSun avatar Jan 01 '24 17:01 AntonioSun