Problem with apt-get update inside a dockerfile (maybe related to network issues)

Hi, I’m trying to use the command:
RUN apt-get update
inside a dockerfile, but this command just hangs forever and there is no response after it.
Also, if I try to exit from this build, the whole computer is stuck and can’t be rebooted (the dockerd process becomes zombie which apparently effects the whole system).
I thought it could be related to network issues because it start happening after my system (ubuntu 16.04)
couldn’t connect to the wifi for some time.
Also, I changed the default data folder used to store images and containers.

These are my docker details:

Client:
Debug Mode: false

Server:
Containers: 10
Running: 2
Paused: 0
Stopped: 8
Images: 4
Server Version: 19.03.9
Storage Driver: aufs
Root Dir: /media/DATA/Docker-Root/aufs
Backing Filesystem:
Dirs: 42
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.15.0-50-generic
Operating System: Ubuntu 16.04.6 LTS
OSType: linux
Architecture: x86_64
CPUs: 12
Total Memory: 31.34GiB
Name: demo2
ID: GQ56:YN4L:DIIG:WRV4:MKI4:YM35:JUJP:3KKA:K3QO:374J:IHFS:6UCZ
Docker Root Dir: /media/DATA/Docker-Root
Debug Mode: false
Username: rang
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support
WARNING: the aufs storage-driver is deprecated, and will be removed in a future release.