Bash scripting: How to create a new custom resource file from a template file using sed?

In this blog post we use an existing template file, that we created for a custom resource to insert the needed value for an URL to point to a container image in a container registry, to create custom resource yaml file we use to deploy that custom resource . The template file contains a string which we will replace with the content of URL to the container image. We haven't used helm, kustomize to do that in this situation.