mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 11:48:43 -07:00
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
12 lines
277 B
Docker
12 lines
277 B
Docker
FROM golang:1.7.6
|
|
|
|
MAINTAINER Ivan Kozlovic <ivan.kozlovic@apcera.com>
|
|
|
|
COPY . /go/src/github.com/nats-io/gnatsd
|
|
WORKDIR /go/src/github.com/nats-io/gnatsd
|
|
|
|
RUN CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o gnatsd.exe .
|
|
|
|
ENTRYPOINT ["go"]
|
|
CMD ["version"]
|