我创建了一个Scala项目,该项目使用两个Docker的容器(奇异性/ datastore-emulator和bigtruedata / gcloud-pubsub-emulator)创建了一个testcontainer(通过com.dimafeng.testcontainers)。成功创建了testcontainer,当我运行docker ps命令时,这就是我看到的内容:
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->8080/tcp testcontainers-ryuk-371a41c2-3d23-426f-943d-608a816c96d3
现在,当我尝试运行容器时会出现问题:
$ 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
如果我进入容器并运行/ app命令,这就是我得到的:
$ 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
从设置docker-machine eval默认值到检查所有可能的权限问题,我实际上已经尝试了所有方法。我想念什么?
(我根本无法访问出现在错误中的go文件)
这是有关我的docker安装的信息
$ 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
和信息
$ 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