Docker build for docker/whalesay is failing on apt-get


I have just started using Docker and was following the steps in the basic tutorial for building an image by modifying the docker/whalesay.

For the second line
RUN apt-get -y update && apt-get install -y fortunes

I am seeing the following error

Err trusty-security Release.gpg
Could not resolve '
Reading package lists…
W: Failed to fetch

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The command ‘/bin/sh -c apt-get -y update && apt-get install -y fortunes’ returned a non-zero code: 100

I have tried the solutions mentioned by creating a daemon.json file and even uncommenting the docker file for the dns option.
I have also commented dnmasq and tried but still seeing this issue.

Any help would be appreciated.

Update :

Fixed the issue by adding the local machine dns in the daemon.json file