centos – Creating an image in Docker

I'm trying to build an image with a dnsmasq server from a basic CentOS image.

I have already tried to do a pull of the CentOS image and with docker run -it centos enter the image and download with yum install -y dnsmasq but when then I'm going to configure the file that supposedly should be in /etc/dnsmasq.conf it does not appear to me, as if it had not been created when installed.

Does anyone have any idea how I can do this?

Thank you very much in advance 😉