Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Allow ports for server and agents to be set using environment variables #11

Open
JorritSalverda opened this issue Aug 26, 2015 · 2 comments

Comments

@JorritSalverda
Copy link

Would be useful to be able to set the following environment variables to control the ports the docker container uses internally.

GO_SERVER_PORT
GO_SERVER_SSL_PORT

The current containers always use the values in /etc/default/go-server or /etc/default/go-agent. Those files should check if the environment variables aren't set already and then use those.

Or is there an alternative to running /sbin/my_init in order to provide those environment variables yourself?

@arvindsv
Copy link
Member

You could try this. As you can see here, the startup script runs a file called /init.sh, if it is in the container. So, you can mount a file of that name and change the port used in /etc/default/go-server. I can't easily change that file to check for the environment variables, since it comes from the app and changing it will affect all existing users.

@JorritSalverda
Copy link
Author

The init.sh - although executed - didn't seem to override the settings from /etc/default/go-server. I'm trying to mount a custom file instead of the /etc/default/go-server.

erithmetic added a commit to erithmetic/gocd-docker that referenced this issue Sep 6, 2015
There is no need to use init scripts to start the agent service within a docker
container. The Phusion team didn't really "get" docker when they built their
images and published their recommendations a year ago.

This solves a problem where the container didn't respond properly to signals
like SIGINT/SIGTERM.

This image is based off of the official Java 7 headless JRE, which helps limit
image size. It's now 339MB vs 433MB.

This PR can also help fix gocd#11
macat pushed a commit to macat/gocd-docker that referenced this issue Sep 22, 2015
There is no need to use init scripts to start the agent service within a docker
container. The Phusion team didn't really "get" docker when they built their
images and published their recommendations a year ago.

This solves a problem where the container didn't respond properly to signals
like SIGINT/SIGTERM.

This image is based off of the official Java 7 headless JRE, which helps limit
image size. It's now 339MB vs 433MB.

This PR can also help fix gocd#11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants