boot2podman / machine

Apache License 2.0
120 stars 16 forks source link

"podman-machine create" shows wrong hint command for env #21

Closed medyagh closed 4 years ago

medyagh commented 4 years ago

first of all thank you so much for this great tool ! i trying podman for the very first time on Mac using podman-machine !

here is a small issue that could be imrpoved:

podman-machine create suggested I should run

To see how to connect your Podman client to Podman server running on this virtual machine, run: 
podman-machine env p1

which will cause this error :

Error: error creating libpod runtime: dial unix /run/podman/io.podman: connect: no such file or directory

<details>
<pre>
$ podman-machine create p1
Creating CA: /Users/medmac/.local/machine/certs/ca.pem
Creating client certificate: /Users/medmac/.local/machine/certs/cert.pem
Running pre-create checks...
(p1) Image cache directory does not exist, creating it at /Users/medmac/.local/machine/cache...
(p1) No default Boot2Podman ISO found locally, downloading the latest release...
(p1) Latest release for github.com/boot2podman/boot2podman is v0.26
(p1) Downloading /Users/medmac/.local/machine/cache/boot2podman.iso from https://github.com/boot2podman/boot2podman/releases/download/v0.26/boot2podman.iso...
(p1) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
Creating machine...
(p1) Copying /Users/medmac/.local/machine/cache/boot2podman.iso to /Users/medmac/.local/machine/machines/p1/boot2podman.iso...
(p1) Creating VirtualBox VM...
(p1) Creating SSH key...
(p1) Starting the VM...
(p1) Check network to re-create if needed...
(p1) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2podman...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Checking connection to Podman...
Podman is up and running!
To see how to connect your Podman client to Podman server running on this virtual machine, run: podman-machine env p1
</pre>
</details>

but infact to make it work I had to run this

eval $(podman-machine env p1 --varlink)

afbjorklund commented 4 years ago

Glad you like it!

The podman upstream environment variables have changed a bit over time. The old ones were supposed to still work (thought I tested them), but I guess we could default to car link bridge if the straight address is not working anymore...

afbjorklund commented 4 years ago

When it says "run", it really means "run this command, and do what it says (depending on shell)"

sh

# Run this command to configure your shell: 
# eval $(podman-machine env p1 --varlink)

csh

: Run this command to configure your shell: 
: eval `podman-machine env p1 --varlink`

Whether it is eval or something else, actually depends on the user's shell. So the help is correct.