How to containerize a bash script that contains "podman run"?
I have a bash script that contains: podman run --rm localhost/img1 prog1 somearg1 podman run --rm localhost/img2 prog2 otherarg1 It works just fine. The command-line tools prog1 and prog2 perform some calculations. Now I would like to containerize the bash script and run everything in a pod. Do you have any tips on how to proceed? One idea I had was to create a new container image based on localhost/img1, but with the addition of a gRPC service or a Varlink service for executing prog1. This service would make use of a Unix domain socket. The same things would be done for localhost/img2. Do you know of any tools that automate the writing of such a service (i.e. a service that wraps a command-line tool)? Socket activation and some exit-on-idle functionality would be cool (but not so important). (Socket activation might not be available in gRPC https://github.com/grpc/grpc/issues/19133) Thanks, Erik
On 8/17/20 15:58, Erik Sjölund wrote:
I have a bash script that contains:
podman run --rm localhost/img1 prog1 somearg1 podman run --rm localhost/img2 prog2 otherarg1
It works just fine. The command-line tools prog1 and prog2 perform some calculations.
Now I would like to containerize the bash script and run everything in a pod.
Do you have any tips on how to proceed?
One idea I had was to create a new container image based on localhost/img1, but with the addition of a gRPC service or a Varlink service for executing prog1. This service would make use of a Unix domain socket. The same things would be done for localhost/img2.
Do you know of any tools that automate the writing of such a service (i.e. a service that wraps a command-line tool)? Socket activation and some exit-on-idle functionality would be cool (but not so important). (Socket activation might not be available in gRPC https://github.com/grpc/grpc/issues/19133)
Thanks, Erik _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
Have you looked at setting up a systemd service to execute the podman commands podman generate systemd --new Might do what you want, + some socket activation.
participants (2)
-
Daniel Walsh -
Erik Sjölund