title: Restrict Docker exposed port from only specific IP adresses
body: <p>How to restrict a container's port exposed by Docker from only a list of IPs? Only this list of IP would be able to access this port.</p>
  
  <p>I tried that:</p>
  
  <pre><code>iptables -I DOCKER -p tcp --dport PORT_X -j REJECT --reject-with icmp-port-unreachable
  iptables -I DOCKER -p tcp --dport PORT_X --source EXTERNAL_IP_1 --destination HOST_IP_1 -j ACCEPT
  iptables -I DOCKER -p tcp --dport PORT_X --source EXTERNAL_IP_2 --destination HOST_IP_1 -j ACCEPT
  iptables -I DOCKER -p tcp --dport PORT_X --source EXTERNAL_IP_3 --destination HOST_IP_1 -j ACCEPT
  </code></pre>