Download and build podman-compose using docker/podman locally
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.
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.
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:
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
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.
Thanks a lot for fixes, they look great.
I rebased to squash fixup commits into the commit they are fixing.