Restrict docker-on-mac container to be able to connect to single IP address

I would like to restrict the docker container to be able to connect to a fixed ip address. Basically i want to block the whole network except a single ip address. Please let me know how i can achieve this.

There is one way explained in the issue https://github.com/docker/for-mac/issues/1390