title: Cannot connect to the Docker daemon at unix:///var/run/docker.sock on OSX
body: <p>I've created a Scala project that creates a testcontainer (via com.dimafeng.testcontainers) with two Docker's containers (singularities/datastore-emulator and bigtruedata/gcloud-pubsub-emulator). The testcontainer is successfully created, when I run the docker ps command this is what I see:</p>
  
  <pre><code>CONTAINER ID        IMAGE                               COMMAND             CREATED             STATUS              PORTS                     NAMES
  ddc16471205a        quay.io/testcontainers/ryuk:0.2.2   "/app"              2 minutes ago       Up 2 minutes        0.0.0.0:32771-&gt;8080/tcp   testcontainers-ryuk-371a41c2-3d23-426f-943d-608a816c96d3
  </code></pre>
  
  <p>Now, the problem occurs when I try to run the container:</p>
  
  <pre><code>$ docker run -p 4000:80 quay.io/testcontainers/ryuk:0.2.2
  2018/12/13 10:59:48 Starting on port 8080...
  panic: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
  
  goroutine 1 [running]:
  main.main()
      /go/src/github.com/bsideup/moby-ryuk/main.go:31 +0xe2e
  </code></pre>
  
  <p>And if I go inside the container and run the /app command this is what I get:</p>
  
  <pre><code>$ docker exec -it ddc /bin/sh
  / # /app
  2018/12/13 11:40:55 Starting on port 8080...
  panic: runtime error: invalid memory address or nil pointer dereference
  [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x64f8d6]
  
  goroutine 9 [running]:
  main.main.func1(0xc4200685a0, 0xc4201bd890, 0xc420068600)
      /go/src/github.com/bsideup/moby-ryuk/main.go:42 +0x286
  created by main.main
      /go/src/github.com/bsideup/moby-ryuk/main.go:39 +0x1b5
  </code></pre>
  
  <p>I've tried literally everything from setting the docker-machine eval default to check all the possible permissions problems. What am I missing?</p>
  
  <p>(I have no access at all to the go files present in the errors)</p>
  
  <p>Here's the information about my docker installation</p>
  
  <pre><code>$ docker version
  Client: Docker Engine - Community
  Version:           18.09.0
   API version:       1.39
   Go version:        go1.10.4
   Git commit:        4d60db4
   Built:             Wed Nov  7 00:47:43 2018
   OS/Arch:           darwin/amd64
   Experimental:      false
  
  Server: Docker Engine - Community
   Engine:
    Version:          18.09.0
    API version:      1.39 (minimum version 1.12)
    Go version:       go1.10.4
    Git commit:       4d60db4
    Built:            Wed Nov  7 00:55:00 2018
    OS/Arch:          linux/amd64
    Experimental:     false
  </code></pre>
  
  <p>And the infos</p>
  
  <pre><code>$ docker info
  Containers: 19
   Running: 1
   Paused: 0
   Stopped: 18
  Images: 7
  Server Version: 18.09.0
  Storage Driver: overlay2
   Backing Filesystem: extfs
   Supports d_type: true
   Native Overlay Diff: true
  Logging Driver: json-file
  Cgroup Driver: cgroupfs
  Plugins:
   Volume: local
   Network: bridge host 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: 468a545b9edcd5932818eb9de8e72413e616e86e
  runc version: 69663f0bd4b60df09991c08812a60108003fa340
  init version: fec3683
  Security Options:
   seccomp
    Profile: default
  Kernel Version: 4.9.125-linuxkit
  Operating System: Docker for Mac
  OSType: linux
  Architecture: x86_64
  CPUs: 4
  Total Memory: 1.952GiB
  Name: linuxkit-025000000001
  ID: 5XHJ:QGZD:4I55:WLU6:RLUF:E5XL:XFUL:PMBB:D432:IJFX:EUPG:QEVW
  Docker Root Dir: /var/lib/docker
  Debug Mode (client): false
  Debug Mode (server): true
   File Descriptors: 33
   Goroutines: 58
   System Time: 2018-12-13T11:34:52.2335167Z
   EventsListeners: 2
  HTTP Proxy: gateway.docker.internal:3128
  HTTPS Proxy: gateway.docker.internal:3129
  Registry: https://index.docker.io/v1/
  Labels:
  Experimental: false
  Insecure Registries:
   127.0.0.0/8
  Live Restore Enabled: false
  Product License: Community Engine
  </code></pre>