You can save the state of a running container as a new image. This is somewhat similar to "creating a snapshot" when working with virtual machines.
If you use Docker, just replace podman
with docker
in the below commands.
$ podman container commit <container name or id> <new-image:tag>
$ podman container commit ansible ansible:2022-04-11