podman-compose icon indicating copy to clipboard operation
podman-compose copied to clipboard

Download and build podman-compose using docker/podman locally

Open iruzo opened this issue 1 year ago • 3 comments

Reason for this PR

As a user of Fedora Silverblue I found that the easiest ways to install podman-compose are:

  • Open a toolbox/distrobox container, install there the python dependencies, use pyinstaller, generate a podman-compose binary and move it outside of the container to use it.
  • Create a virtual env, install dependencies and use pyinstaller to compile it.
  • Install Podman Desktop and let it install and manage podman-compose.
  • [Not actually podman-compose] Manually set podman.socket and downloading docker-compose.

I just wanted to execute a single command and obtain a binary I can save on my home directory without modifying anything outside my $HOME.

Changes

  • Adds Dockerfile that compiles podman-compose and let the binary on /result.
  • Adds a script to generate the binary and drop it on the current directory.
  • Adds script to simplify this process so people can just "download" the binary by executing a single shell command.

Usage

sh -c "$(curl -sSL https://raw.githubusercontent.com/containers/podman-compose/main/scripts/download_podman-compose.sh)"

Using this approach, everything happens within the build steps of the Dockerfile, so no dependencies or temporary files should be left on your system.

Thanks in advance. Any suggestions are welcome.

iruzo avatar Sep 21 '24 12:09 iruzo

Thanks for the PR. It will take some time to review it. Ideally I would like to have this as part of release process so that the executables are added to release artifacts.

p12tic avatar Sep 26 '24 00:09 p12tic

Hey @p12tic,

Thank you for being so fast to reply to my PR. I just added in a commit a release.yml that add the binary to the next release (in case GITHUB_TOKEN is enabled in the repo).

Please, take your time to review the PR, there is no need to rush, thanks for just taking a look at it :smiley:

iruzo avatar Oct 17 '24 12:10 iruzo

I actually forgot about this PR because I somehow thought that I'm waiting for something from you. Thanks for the ping. I have reviewed the PR now, looks good except several comments that should be simple to address.

p12tic avatar Oct 19 '24 11:10 p12tic

@p12tic I just pushed the change to stop doing a recursive search on the directory tree. Also, I noticed that docker build does not have a -v parameter (oopsie, since I use podman, I didn't notice until I try it today), I changed the script so it would also work with docker.

iruzo avatar Oct 23 '24 22:10 iruzo

Thanks a lot for fixes, they look great.

p12tic avatar Nov 03 '24 13:11 p12tic

I rebased to squash fixup commits into the commit they are fixing.

p12tic avatar Nov 03 '24 13:11 p12tic