无法停止Docker容器 – 连接期间出错 – Docker Toolbox

我试图集成VSTS与Docker运行自动化testing,并且我想dockerize我的数据库维护一致的数据库状态在testing之间,无需照顾清理步骤,运行一个新的容器没有任何修改。 但是,我从Docker接收了很多错误来容纳一个SQL Server数据库。 我的容器经常挂起,我无法停止或删除这些容器,而无需重启Boot2Docker虚拟机。 有时候,我收到错误消息之后的任何Docker命令的错误消息。 即使一个简单的docker ps或者docker版本在一个容器挂起后不工作(有时这些命令有效,但是在容器挂起之后停止或者移除),给我下面的错误信息:

  • 连接期间出错:Post https://192.168.99.100:2376/v1.26/containers/container-name/stop:dial tcp 192.168.99.100:2376:connectex :连接尝试失败,因为连接方没有正确响应一段时间,或build立的连接失败,因为连接的主机没有响应。

如果在此问题之后重新打开Docker快速入门terminal,我收到以下错误说明:

  • 获取IP地址出错:ssh命令错误:命令:ip addr show err:退出状态255

因此,我不得不手动停止默认的docker机,然后重新打开Docker快速入门。

我已经使用由Microsoft SQL Server发布的容器来评估我的解决scheme,所以相信这个容器应该可以正常工作。 因此,为了testing我的环境,我创build了一个简单的netcat服务器应用程序来发送多个连接,并评估我的操作系统或Docker Toolbox或任何相关的东西是否导致这些问题,但是testing这个简单的Docker服务器有几个线程在几次迭代中发送大量的消息,我的解决scheme正常工作,没有任何错误。 Dockerfile:

FROM centos:latest RUN yum install nc -y EXPOSE 1433CMD nc -l -k 1433 > /out.netcat CMD nc -l -k 1433 > /out.netcat 

有没有解决这些问题的解决scheme,甚至是避免它的方法? 在Google寻找解决scheme,我找不到任何解决scheme,我只是确定有其他人有相同的错误。 可以使用Docker来容器化数据库吗?

环境:

 $ docker version time="2017-03-31T10:23:50-03:00" level=info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows" Client: Version: 1.13.1 API version: 1.26 Go version: go1.7.5 Git commit: 092cba3 Built: Wed Feb 8 08:47:51 2017 OS/Arch: windows/amd64 Server: Version: 17.03.0-ce API version: 1.26 (minimum version 1.12) Go version: go1.7.5 Git commit: 3a232c8 Built: Tue Feb 28 07:52:04 2017 OS/Arch: linux/amd64 Experimental: false $ docker info time="2017-03-31T10:27:10-03:00" level=info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows" Containers: 2 Running: 0 Paused: 0 Stopped: 2 Images: 25 Server Version: 17.03.0-ce Storage Driver: aufs Root Dir: /mnt/sda1/var/lib/docker/aufs Backing Filesystem: extfs Dirs: 25 Dirperm1 Supported: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host macvlan null overlay Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: 977c511eda0925a723debdc94d09459af49d082a runc version: a01dafd48bc1c7cc12bdb01206f9fea7dd6feb70 init version: 949e6fa Security Options: seccomp Profile: default Operating System: Boot2Docker 17.03.0-ce (TCL 7.2); HEAD : f11a204 - Thu Mar 2 00:14:47 UTC 2017 OSType: linux Architecture: x86_64 CPUs: 1 Total Memory: 3.491 GiB Name: default ID: 56MH:QSVM:SCCQ:DKVC:HBNI:AYJK:UCQN:2UJZ:A4NV:KOZQ:XC67:EEPY Docker Root Dir: /mnt/sda1/var/lib/docker Debug Mode (client): false Debug Mode (server): true File Descriptors: 14 Goroutines: 22 System Time: 2017-03-31T13:27:08.809341202Z EventsListeners: 0 Username: pablogoulart Registry: https://index.docker.io/v1/ Labels: provider=virtualbox Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false 

docker日志容器名称:

 This is an evaluation version. There are [164] days left in the evaluation period. RegQueryValueEx HADR for key "Software\Microsoft\Microsoft SQL Server\MSSQL\MSSQLServer\HADR" failed. 2017-03-31 12:30:40.77 Server Microsoft SQL Server vNext (CTP1.4) - 14.0.405.198 (X64) Mar 11 2017 01:54:12 Copyright (C) 2016 Microsoft Corporation. All rights reserved. on Linux (CentOS Linux 7 (Core)) 2017-03-31 12:30:40.78 Server UTC adjustment: 0:00 2017-03-31 12:30:40.78 Server (c) Microsoft Corporation. 2017-03-31 12:30:40.78 Server All rights reserved. 2017-03-31 12:30:40.78 Server Server process ID is 4116. 2017-03-31 12:30:40.78 Server Logging SQL Server messages in file 'C:\var\opt\mssql\log\errorlog'. 2017-03-31 12:30:40.79 Server Registry startup parameters: -d C:\var\opt\mssql\data\master.mdf -l C:\var\opt\mssql\data\mastlog.ldf -e C:\var\opt\mssql\log\errorlog 2017-03-31 12:30:41.29 Server SQL Server detected 1 sockets with 1 cores per socket and 1 logical processors per socket, 1 total logical processors; using 1 logical processors based on SQL Server licensing. This is an informational message; no user action is required. 2017-03-31 12:30:41.34 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required. 2017-03-31 12:30:41.37 Server Detected 2860 MB of RAM. This is an informational message; no user action is required. 2017-03-31 12:30:41.37 Server Using conventional memory in the memory manager. 2017-03-31 12:30:41.51 Server Default collation: SQL_Latin1_General_CP1_CI_AS (us_english 1033) 2017-03-31 12:30:41.76 Server Buffer pool extension is already disabled. No action is necessary. 2017-03-31 12:30:41.97 Server InitializeExternalUserGroupSid failed. Implied authentication will be disabled. 2017-03-31 12:30:41.98 Server Implied authentication manager initialization failed. Implied authentication will be disabled.