I have some problems running docker on a Debian (Stretch) VM hosted by our IT. I need to run dockerd
as sudo, but under sudo I cannot access internet locations, because the VM admin set the option
in /etc/sudoers
which wipes the proxy settings.
So, if I run
$>sudo docker run hello-world
I get a timeout error because sudo cannot reach out to internet locations. If I run
$>export HTTP_PROXY=our_proxy
$>sudo -E docker run hello-world
I get an error message
docker: Cannot connect to the Docker daemon at unix:///home/myusername/.docker/run/docker.sock. Is the docker daemon running?.
Obviously, the -E
option somehow changes as well the path where docker looks for the file docker.sock
- which resides at /run/
How can I get around this issue?
question from:
https://stackoverflow.com/questions/65912959/problem-with-accessing-docker-sock-when-running-sudo-e-docker 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…