0

I'm trying to integrate VSTS with Docker to run automated tests, and I want to dockerize my databases to maintain a consistent database state among tests without take care of cleanup step, running a new container with no modifications. But I have receiving a lot of errors from Docker for containerize a SQL Server database. Frequently my containers hangs, and I can't stop or remove these containers without reboot the Boot2Docker VM. Sometimes, I receive a error message for any Docker command after that error. Even a simple docker ps or docker version didn't work after a container hangs (sometimes these commands work, but stop or remove don't after container hanging), giving me the following error message:

If I reopen the Docker QuickStart Terminal after this issue, I receive the following error description:

  • Error getting IP address: ssh command error: command : ip addr show err : exit status 255

Because of that, I have to manually stop the default docker machine and reopen Docker Quickstart.

I have using a container released by Microsoft SQL Server to evaluate my solution, so a believe this container should work properly. So, to test my environment, I created a simple app with netcat server just to send several connections and evaluate whether for any reason my operating system, or Docker Toolbox, or anything related with, were causing these problems, but testing this simple docker server with several threads sending a lot of messages in several iterations my solution work properly with none errors. Dockerfile:

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

Are there any released solution for these problems, or even an way to avoid it? Looking for solutions in Google, I couldn't identify any solution, I just identified that there are others with the same errors. Can Docker be used to containerize databases?

Environment:

$ 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.
Pablo
  • 386
  • 2
  • 5
  • Can you provide the detail build logs here? – starian chen-MSFT Apr 03 '17 at 02:58
  • @starain-MSFT, thank you by your interest. Currently, I am verifying the possibility of the container (PID 1) process is not responding the docker stop signal. As said in dockerfile reference, ENTRYPOINT must be carefully used because bash process do not forward signals for their childs (as said https://linux.die.net/man/2/fork). – Pablo Apr 04 '17 at 14:17
  • @starain-MSFT I am rebuilding the DBs containers from zero to verify this possibility. Resuming, I will try to put as PID 1 the database server process, not a bash that call this process. In this way, the db server can answer the KILL signal. – Pablo Apr 04 '17 at 14:19
  • @starain-MSFT Also, to avoid an undefined state, I will wait all database process start correctly to call docker stop. This could be obvious but I was calling docker stop during the process starting, when, possibly, no callback was configured to answer these signals, causing a undefined state that docker could not manage correctly. Just a guess, for now! – Pablo Apr 04 '17 at 14:25
  • How do you integrate VSTS with docker? Use "Docker Integration" extension? And when does the container hang? Does it occur without VSTS? – Eddie Chen - MSFT Apr 06 '17 at 06:30
  • @Eddie-MSFT I do integrate Docker with VSTS, but I'm not using Docker integration extension because my VSTS build agent is on a Windows machine, and my 'dockerized' databases are on a Linux. So, currently I'm using a powershell script to do a SSH connection from build agent to Docker Linux machine and run/stop/rm my docker containers. I've facing hanging that I couldn't solve completely. But, on Fedora, I found my best environment to docker containers until now. – Pablo Apr 06 '17 at 13:24
  • I have reported a similar issue [here](https://github.com/docker/for-win/issues/2596). I do not understand why people still use Docker to publish their software. it is awful! – Foad S. Farimani Sep 12 '18 at 11:37
  • @Foad Docker is still a great solution. Publishing software using containers allows you to maintain a consistent image among environments (dev, preqa, prod) and also to manage dependencies directly in dev step. If you use Kubernetes or another orchestrator, you can also manage the containers in a mesh solution in an organized way. – Pablo Jan 05 '19 at 10:37

0 Answers0