Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dive with podman on MacOS #368

Closed
bhundven opened this issue Sep 16, 2021 · 4 comments · Fixed by #390
Closed

dive with podman on MacOS #368

bhundven opened this issue Sep 16, 2021 · 4 comments · Fixed by #390
Labels
enhancement Add a new feature

Comments

@bhundven
Copy link

I'm trying to use dive with podman on MacOS.

$ dive version
dive 0.10.0

I'm using a local build of podman, since there was a bug fixed upstream that hasn't been released yet:

$ podman version
Client:
Version:      4.0.0-dev
API Version:  4.0.0-dev
Go Version:   go1.16.2
Git Commit:   c0cde378298bd8d5183155c8f62aae574be069eb-dirty
Built:        Wed Sep 15 09:47:15 2021
OS/Arch:      darwin/amd64

Server:
Version:      3.3.1
API Version:  3.3.1
Go Version:   go1.16.6
Built:        Mon Aug 30 13:46:36 2021
OS/Arch:      linux/amd64

But I guess this setup is still unsupported?

$ dive --source podman docker.io/hello-world
Image Source: podman://docker.io/hello-world
Fetching image... (this can take a while for large images)
cannot fetch image
unsupported platform

I am able to build images using podman with this dev release, and the bug fix for podman on MacOS will be released in podman 3.4 (so, soon).

@fxw
Copy link

fxw commented Oct 30, 2021

Any news on this issue ?

@seanleblancicdtech
Copy link

Try soft linking your podman to docker binary -

ln -s /usr/local/podman /usr/local/bin/docker

You may have to export your DOCKER_HOST value (podman will print something like this out on podman start) or install podman-mac-helper.

@ssbarnea
Copy link

@seanleblancicdtech Doing the symlinking is not needed but exporting the DOCKER_HOST from podman is mandatory in order to fool dive into using podman machine on macos. Basically we do not need to uninstall docker to run dive with podman, but with extra manual hacks, which is clearly far from ideal.

@jorisroovers
Copy link

jorisroovers commented Dec 23, 2022

Still running into this but got it to work by setting DOCKER_HOST="ssh://core@localhost:63444", which I found through podman system connection list.

> dive --version && podman --version
dive 0.10.0
podman version 4.3.1

# Not working by default
> dive docker.io/hello-world
Image Source: docker://docker.io/hello-world
Fetching image... (this can take a while for large images)
Handler not available locally. Trying to pull 'docker.io/hello-world'...
Using default tag: latest
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
cannot fetch image
exit status 1

# Find the connection string
> podman system connection list
Name                         URI                                                         Identity                                     Default
podman-machine-default       ssh://core@localhost:63444/run/user/501/podman/podman.sock  /Users/jroovers/.ssh/podman-machine-default  true
podman-machine-default-root  ssh://root@localhost:63444/run/podman/podman.sock           /Users/jroovers/.ssh/podman-machine-default  false

> export DOCKER_HOST="ssh://root@localhost:63444"

# Works now!
> dive docker.io/hello-world

# Also works with local images
> podman build -t myimage .
> dive myimage

# Building images directly via dive doesn't work this way, so need to build them first and then run dive
> dive build -t myimage .
Building image...
Sending build context to Docker daemon  111.7MB
request returned Bad Request for API route and version http://docker.example.com/v1.41/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=myimage&target=&ulimits=null&version=1, check if the server supports the requested API version
cannot build image
exit status 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Add a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants