-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIXED] Windows Docker Images #544
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question but lgtm.
WORKDIR /go/src/github.com/nats-io/gnatsd | ||
|
||
RUN CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o gnatsd.exe . | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we set NATS_WIN_CONTAINER
in this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, should this environment variable be documented somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Dockerfile is just used to build the executable. The executable will be extracted from nats-docker/update.sh
and copied in respective nats-docker/windows
sub-directories. This repo has not yet been updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check: nats-io/nats-docker#8
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
It is failing to instantiate itself as a Windows service See: - nats-io/nats-docker#9 - nats-io/nats-server#544 [#169546670] Co-authored-by: Sunjay Bhatia <[email protected]>
The use of the
svc
API prevented the NATS Server to run asa 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