There are 3 ways to get what you want more easily:
1. With Fedora Silverblue 39 the most straightforward way is to add a Dockerfile layer just which makes your changes directly to the base image.
2. You can also create your own RPM and make the changes there.
3. Best is to actually run your script in an Ubuntu container (distrobox, toolbx, or podman).