How to mimic a Docker registry down situation
I’m trying to test how our app handles when the Docker registry becomes unavailable for it to pull Docker images, and want to mimic the situation.
I don’t have any control over the firewall rule of the network or DNS of the servers. The only changes I can make are on the VM I’m using, like VM configurations and Docker configurations. Wondering what I can do to make it as if Dockerhub is down?
One Solution collect form web for “How to mimic a Docker registry down situation”
You can use the iptables to filter the output on your VM and dropping packet
For example :
# iptables -A OUTPUT -d 192.168.12.34 -j DROP
# iptables -A OUTPUT -p tcp -d 192.168.12.34 --dport 80,443 -j DROP