Skip to content
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

Merged
merged 1 commit into from
Jul 19, 2017
Merged

[FIXED] Windows Docker Images #544

merged 1 commit into from
Jul 19, 2017

Conversation

kozlovic
Copy link
Member

@kozlovic kozlovic commented Jul 17, 2017

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

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 91.236% when pulling 44ada9e on fix_win_docker into 9a44c20 on master.

Copy link
Contributor

@tylertreat tylertreat left a 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 .

Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 91.302% when pulling 9cddf0f on fix_win_docker into 9a44c20 on master.

@kozlovic kozlovic merged commit d26bef4 into master Jul 19, 2017
@kozlovic kozlovic deleted the fix_win_docker branch July 19, 2017 01:18
sunjayBhatia added a commit to cloudfoundry/diego-release that referenced this pull request Nov 12, 2019
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants