4

I have a virtualenv issue in my CentOS7 VM:

Checking for virtualenv...
Activating virtual environment /home/crimson/venv/python3
/home/crimson/venv/python3/myvra.json matches /home/crimson/venv/myvra.json
/home/crimson/venv/python3/myvrni.json matches /home/crimson/venv/myvrni.json
Error: Could not connect to Docker (is it running?)
crimson@CentOS-7:~/bin$

Here is the output of my Python and pip checks:

crimson@CentOS-7:~/bin$ python --version
Python 3.6.3
crimson@CentOS-7:~/bin$ pip --version
pip 19.3.1 from /home/crimson/venv/python3/lib/python3.6/site-packages/pip (python 3.6)

Docker is running and when I test docker run hello-world it works as expected:

    crimson@CentOS-7:~/bin$ service docker status
    Redirecting to /bin/systemctl status docker.service
    ● docker.service - Docker Application Container Engine
       Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
       Active: active (running) since Tue 2019-10-29 21:00:44 MDT; 7min ago
         Docs: http://docs.docker.com
     Main PID: 1180 (dockerd-current)
       CGroup: /system.slice/docker.service
               ├─1180 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --def...
               └─1251 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.soc...

 Container Engine.
    Hint: Some lines were ellipsized, use -l to show in full.
    crimson@CentOS-7:~/bin$
    crimson@CentOS-7:~/bin$ docker run hello-world

    Hello from Docker!
    This message shows that your installation appears to be working correctly.

Update: I am not having this issue today! I was working from home yesterday, which must be the crux of this - there's some kind of network difference that prevents my Docker image from functioning when I'm not physically in the office.....but I do not know what it is. 

Update 2: This is due to some kind of network difference that I get when working from home: the VPN-client does not have the same resources that I do when I am physically in the office with my laptop. I am unable to fix this, unfortunately.

KidACrimson
  • 320
  • 1
  • 10
  • 24
  • 2
    You should check if by default you are not trying to connect via tcp instead of the unix socket. As it seems that that's the default in some recent versions of docker. If you switch to socket it should always work. – Gothrek Nov 05 '19 at 10:11
  • Could you provide your network configuration? – Alexander Tolkachev Nov 06 '19 at 11:50

1 Answers1

0

I've seen issues myself when I don't run docker without running sudo. I dont know exactly what you're running but it may look something like the below items:

sudo docker run [thing you want to run]

sudo [docker command you're running]

confoundr
  • 347
  • 3
  • 8
  • 18
  • Thank you. It make no difference if I run Docker with or without `sudo` in this case. It's some kind of network issue that I get when working from home: the VPN does not have the same resources that I do when I am physically in the office with my laptop. I am unable to fix this, unfortunately. – KidACrimson Nov 09 '19 at 20:36