Adding Rules to the Firewall for Docker Pull Commands

Is it possible to use docker-compose by adding some rules to firewall? Because our server’s internet connection is restricted. We added the ip addresses of the domain ( but we realized that ip addresses of this domain changes time to time. And also we cannot add domain names to firewall configurations we can add only the ip addresses as rules.

Yes, one way is to use a shell script in cron that periodically checks for the right IP and adds it to your firewall and then removes the old IP.