Created
November 28, 2022 14:54
-
-
Save c5m/1d41575c1fe3c3bc7cf948cf4ffdf31c to your computer and use it in GitHub Desktop.
An example of how to set up a connection from MacOS to inside the Podman Host VM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
# run script with TRACE=1 ... to enable debugging | |
if [[ "${TRACE-0}" == "1" ]]; then | |
set -o xtrace | |
fi | |
PODMAN_PORT=$(podman system connection list --format=json | jq '.[0].URI' | sed -E 's|.+://.+@.+:([[:digit:]]+)/.+|\1|') | |
PODMAN_INTERNAL_UID=$(podman system info --format=json | jq '.host.idMappings.uidmap[0].host_id') | |
rm -f /tmp/podman.sock | |
ssh -v -i ~/.ssh/podman-machine-default \ | |
-p "$PODMAN_PORT" \ | |
-L "/tmp/podman.sock:/run/user/$PODMAN_INTERNAL_UID/podman/podman.sock" \ | |
-N core@localhost |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is based on https://stackoverflow.com/questions/71549856/testcontainers-with-podman-in-java-tests