无法阻止Docker容器 - 连接时出错 - Docker Toolbox

时间:2017-03-31 13:38:41

标签: docker boot2docker azure-pipelines docker-toolbox docker-windows

我正在尝试将VSTS与Docker集成以运行自动化测试,并且我希望将我的数据库停靠,以便在测试之间保持一致的数据库状态,而无需清理步骤,运行没有修改的新容器。但是我收到了很多来自Docker的错误,用于容纳SQL Server数据库。我的容器经常挂起,我无法在不重启Boot2Docker VM的情况下停止或删除这些容器。有时,在该错误之后,我收到任何Docker命令的错误消息。容器挂起后,即使是简单的 docker ps docker version 也不起作用(有时这些命令有效,但在容器挂起后停止或删除),给我以下错误消息:

如果我在此问题后重新打开Docker QuickStart终端,则会收到以下错误说明:

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

因此,我必须手动停止默认 docker机器并重新打开Docker Quickstart。

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

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

是否有针对这些问题的解决方案,甚至是避免它的方法?在谷歌寻找解决方案,我找不到任何解决方案,我只是发现有其他人有相同的错误。 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 logs container-name:

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.

0 个答案:

没有答案