Docker context deadline exceeded

I am running docker in raspberry pi os (bulleye) 64 bit version, and I am having trouble getting docker to access the internet. I cannot pull any images, nor can I login using docker login. I checked online to seek help regarding this issue, and most of the answers were regarding setting DNS nameservers. So here’s what I have tried.

  1. Modified /etc/dhcpcd.conf to set static IP along with DNS 192.168.1.1(my router) and 8.8.8.8. I also tried bunch of other DNS servers, but nothing changed the outcome.
  2. restart daemon by sudo systemctl daemon-reload
  3. restart docker by sudo systemctl restart docker

Here is some of the log from journalctl -u docker:

Feb 08 15:43:36 MomNode dockerd[6421]: time=“2024-02-08T15:43:36.022987622-05:00” level=info msg=“Attempting next endpoint for pull after error: Get "https://registry-1.docker.io/v2/\”: context deadline exceeded"
Feb 08 15:43:36 MomNode dockerd[6421]: time=“2024-02-08T15:43:36.034712088-05:00” level=error msg=“Handler for POST /v1.44/images/create returned error: Get "https://registry-1.docker.io/v2/\”: context deadline exceeded"

Please assist further.