我正在尝试将 VSTS 与 Docker 集成以运行自动化测试,并且我想对我的数据库进行 dockerize 以在测试之间保持一致的数据库状态,而不需要注意清理步骤,无需修改即可运行新容器。但是我从 Docker 收到了很多关于容器化 SQL Server 数据库的错误。我的容器经常挂起,如果不重新启动 Boot2Docker VM,我无法停止或删除这些容器。有时,在该错误之后,我会收到任何 Docker 命令的错误消息。即使是简单的docker ps或docker 版本在容器挂起后也不起作用(有时这些命令有效,但在容器挂起后停止或删除不工作),给我以下错误消息:
- 连接期间出错:发布https://192.168.99.100:2376/v1.26/containers/container-name/stop:拨打 tcp 192.168.99.100:2376:connectex:连接尝试失败,因为连接方在之后没有正确响应一段时间,或建立连接失败,因为连接的主机没有响应。
如果我在此问题后重新打开 Docker 快速启动终端,我会收到以下错误描述:
- 获取 IP 地址时出错:ssh 命令错误:命令:ip addr show err:退出状态 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
码头工人日志容器名称:
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.