Mount a .img with CI

I have a base .img Linux kernel I use. I do not remake the whole kernel from scratch every time. Using this manually I can mount it and change the files or filing system as needed. How could I mount the .img using CI?

Using something like Docker would be preferred. So things can be done locally.