Snap docker

I installed the docker snap recently and seems working fine except for the fact that if you have this Dockerfile

FROM python:3.10
RUN pip install pydantic

it fails to fetch the module I tried to debug what’s going on seems like the pip is returning this:

Getting page https://pypi.org/simple/pydantic/
Starting new HTTPS connection (1): pypi.org:443
Incremented Retry for (url='/simple/pydantic/'): Retry(total=4, connect=None, read=None, redirect=None, status=None)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f4155179c00>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pydantic/

My connections of docker says:

snap connections docker 
Interface         Plug                     Slot                                 Notes
content           -                        docker:docker-executables            -
content           -                        docker:docker-registry-certificates  -
docker            docker:docker-cli        docker:docker-daemon                 -
docker-support    docker:privileged        :docker-support                      -
docker-support    docker:support           :docker-support                      -
firewall-control  docker:firewall-control  :firewall-control                    -
home              docker:home              :home                                -
log-observe       docker:log-observe       -                                    -
network           docker:network           :network                             -
network-bind      docker:network-bind      :network-bind                        -
network-control   docker:network-control   :network-control                     -
removable-media   docker:removable-media   -                                    -