[FIXED] Windows Docker Image

The use of the `svc` API prevented the NATS Server to run as
a container on both nanoserver and windowsservercore Docker images.
An attempt was made to replace svc.Debug with normal server.Start()
if detected to be interactive, however, that did not work. The
fact of detecting if interactive or not already requires connecting
to the service controller apparently.
This change looks up for an environment variable (NATS_DOCKERIZED)
and if set to "1", will not make use of the `svc` package.
This environment variable will be set in the Docker image (in
nats-docker/windows/nanoserver/Dockerfile and windowsservercore/Dockerfile).

Resolves #543
This commit is contained in:
Ivan Kozlovic
2017-07-17 13:25:56 -06:00
parent 9a44c20890
commit 9cddf0fcdf
5 changed files with 32 additions and 3 deletions

View File

@@ -4,10 +4,11 @@
package logger
import (
"golang.org/x/sys/windows/svc/eventlog"
"os/exec"
"strings"
"testing"
"golang.org/x/sys/windows/svc/eventlog"
)
// Skips testing if we do not have privledges to run this test.