Git Product home page Git Product logo

Comments (12)

timescam avatar timescam commented on May 25, 2024

I also have the same issue, what I did is create a symbolic link

doas ln -s $(which podman) /opt/homebrew/bin/docker

swap /opt/homebrew/bin to /usr/local/bin if you're on x86

from whalebrew.

tjamet avatar tjamet commented on May 25, 2024

Hi!

Indeed, it uses the docker library to inspect the images.
I will take a look how to improve this part.

from whalebrew.

memark avatar memark commented on May 25, 2024

I'm also on padman nowadays.
@timescam's hack works for me. But it would be nice to be able to just set an env var or smth that whalebrew would respect.

from whalebrew.

tjamet avatar tjamet commented on May 25, 2024

This build contains the dev version of podman support.
It would be great to have your feedback about it.
What works and what not.

On MacOS, you will need to run xattr -d com.apple.quarantine whalebrew-Darwin-$(uname -m) to be able to remove the macOS download warnings and use it.

from whalebrew.

memark avatar memark commented on May 25, 2024

For me this is not working:

  • create a temp dir
  • download the arm64 build to there
  • removing quarantine and set +x
  • add current dir to PATH
  • rename downloaded file to whalebrew
❯ whalebrew version
Whalebrew 0.4.1-1-gef526bd

❯ whalesay
zsh: command not found: whalesay

❯ whalebrew install whalebrew/whalesay
Resolving "whalebrew/whalesay" using unqualified-search registries (/etc/containers/registries.conf.d/999-podman-machine.conf)
Trying to pull docker.io/whalebrew/whalesay:latest...
Getting image source signatures
Copying blob sha256:600c0db384c479cd987f4d191b7e9a689693559e70bead473d017e7196faaafc
Copying blob sha256:c9b1b535fdd91a9855fb7f82348177e5f019329a58c53c47272962dd60f71fc9
Copying blob sha256:aa918feae9a059b2c7e714fb3cb41e84778130c54909e02abd6278d68cc9cffe
Copying blob sha256:4663f495c836a169e811344efa8c99a40c11a1909b6a86f5002f15756d37e6a8
Copying config sha256:cc096d29e7db6c1b624cbcd8da74d041a6a3d55f9b716961b69772c192b4e1f6
Writing manifest to image destination
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
cc096d29e7db6c1b624cbcd8da74d041a6a3d55f9b716961b69772c192b4e1f6
🐳  Installed whalebrew/whalesay to /usr/local/bin/whalesay

❯ whalesay running with podman!
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
Error: statfs /var/folders/pz/cl5g3tqx5yd20d7ylmx629x00000gn/T/tmp.HB4dvGlzsO: no such file or directory

other info

❯ docker --version
zsh: command not found: docker

❯ podman --version
podman version 4.6.2

❯ uname -a
Darwin MEMac 23.0.0 Darwin Kernel Version 23.0.0: Thu Aug 17 21:23:05 PDT 2023; root:xnu-10002.1.11~3/RELEASE_ARM64_T6000 arm64 arm Darwin

Do note that I'm on the Sonoma RC if that matters at all.

image

from whalebrew.

memark avatar memark commented on May 25, 2024

Do note that running the container directly with podman works:

❯ podman run --rm whalebrew/whalesay running with podman!
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
 ______________________
< running with podman! >
 ----------------------
    \
     \
      \
                    ##         .
              ## ## ##        ==
           ## ## ## ## ##    ===
       /"""""""""""""""""\___/ ===
  ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
       \______ o           __/
         \    \         __/
          \____\_______/

from whalebrew.

tjamet avatar tjamet commented on May 25, 2024

Thanks for your input @memark
I think the problem you are facing is that whalebrew mounts the working directory to the container, as described in "How it works"

Because of the way podman and docker works on mac (i.e running in a vm) they don't have access to all folders on the machine.

I think, using the same script and replacing whalesay running with podman! by podman run --rm -v $PWD:/workdir whalebrew/whalesay running with podman! you will have the same problem.
Would it be worth trying?

Here is the result on my machine (x86):

❯ mktemp -d
/var/folders/0d/rvmll2615l19k0sy4g734kcm0000gn/T/tmp.r0XgqFvd

❯ podman run --rm -v /var/folders/0d/rvmll2615l19k0sy4g734kcm0000gn/T/tmp.r0XgqFvd:/workdir --rm whalebrew/whalesay running with podman!
Error: statfs /var/folders/0d/rvmll2615l19k0sy4g734kcm0000gn/T/tmp.r0XgqFvd: no such file or directory

In case you would try the same thing with whalebrew 4.1.0, not having this support, you would get:

❯ whalebrew version
Whalebrew 0.4.1

❯ whalebrew install whalebrew/whalesay
failed to inspect docker image: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

❯ whalesay
exec: "docker": executable file not found in $PATH

I don't have enough knowledge on podman to tell you whether it is achievable with podman or not. With a super quick search I find this issue talking about $HOME but not sure it talks about other volumes
containers/podman#13944

from whalebrew.

memark avatar memark commented on May 25, 2024

@tjamet Actually your first podman example works fine on my machine:

❯ mktemp -d
/var/folders/pz/cl5g3tqx5yd20d7ylmx629x00000gn/T/tmp.zHTSCXYx8p

❯ podman run --rm -v /var/folders/pz/cl5g3tqx5yd20d7ylmx629x00000gn/T/tmp.zHTSCXYx8p:/workdir whalebrew/whalesay running with podman!
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
 ______________________
< running with podman! >
 ----------------------
    \
     \
      \
                    ##         .
              ## ## ##        ==
           ## ## ## ## ##    ===
       /"""""""""""""""""\___/ ===
  ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
       \______ o           __/
         \    \         __/
          \____\_______/

(TBH I don't know much about podman inner workings. I just switched to it due to the changed made to the Docker Desktop licensing model.)

from whalebrew.

tjamet avatar tjamet commented on May 25, 2024

This is interesting.

Whalebrew runs this exact command (assuming podman is in /usr/local/bin/podman, the whalesay file was not changed from the standard installation, the current directory on the host OS is /var/folders/0d/rvmll2615l19k0sy4g734kcm0000gn/T/tmp.2w5oppGh and the current user ID on the local machine is 501.):

❯ /usr/local/bin/podman "run" "--interactive" "--rm" "--workdir" "/workdir" "--init" "--tty" "-v" "/var/folders/0d/rvmll2615l19k0sy4g734kcm0000gn/T/tmp.2w5oppGh:/workdir" "-u" "501:20" "whalebrew/whalesay" "running" "with" "podman"

Would this command work for you?

from whalebrew.

memark avatar memark commented on May 25, 2024
❯ type podman
podman is /opt/homebrew/bin/podman

❯ mktemp -d
/var/folders/pz/cl5g3tqx5yd20d7ylmx629x00000gn/T/tmp.lgJdykhujq

❯ cd /var/folders/pz/cl5g3tqx5yd20d7ylmx629x00000gn/T/tmp.lgJdykhujq

❯ /opt/homebrew/bin/podman "run" "--interactive" "--rm" "--workdir" "/workdir" "--init" "--tty" "-v" "/var/folders/pz/cl5g3tqx5yd20d7ylmx629x00000gn/T/tmp.lgJdykhujq:/workdir" "-u" "501:20" "whalebrew/whalesay" "running" "with" "podman"
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
 _____________________
< running with podman >
 ---------------------
    \
     \
      \
                    ##         .
              ## ## ##        ==
           ## ## ## ## ##    ===
       /"""""""""""""""""\___/ ===
  ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
       \______ o           __/
         \    \         __/
          \____\_______/

from whalebrew.

tjamet avatar tjamet commented on May 25, 2024

I have just tried again with the command from this build, on a mac with m2, the commands above, those worked for me, even running in a temporary directory.

podman client: 4.7.0
podman server: 4.6.2

Do you still observe the behaviour with whalebrew?

from whalebrew.

memark avatar memark commented on May 25, 2024

With that build it works for me to (install and) run whalesay in the normal way. Good work!

from whalebrew.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.