Initially, my docker container was able to get to the external Internet (this is a docker service / container running on Amazon EC2).
Since my application is an API, I followed the creation of my container (he managed to get all the packages he needed) with updating my IP tables to route all traffic from port 80 to the port that my API (running on docker) was listening to.
Then, later, when I tried to restore the container, it failed. After a big fight, I found that my previous step (setting the IPTable port forwarding rule) ruined the possibilities of an external docker network connection.
Decision. Stop the IPTable service:
sudo service iptables stop
Restarting Docker Daemon:
sudo service docker restart
Then try to restore your container. Hope this helps.
Follow up
I completely lost sight of the fact that I did not need to communicate with IP tables in order to forward incoming traffic up to 80 to the port running the docker-based API. Instead, I just used port 80 for the port running the docker API:
docker run -d -p 80:<api_port> <image>:<tag> <command to start api>
Achintya Ashok Apr 03 '18 at 2:54 2018-04-03 02:54
source share