Update Dockerfiles to add backend.enable option to Postgres#1492
Merged
AlvaroVega merged 1 commit intoJun 5, 2018
Conversation
* Add default `postgresql-sink.backend.enable_cache = false` to `agent.conf` file * Amend entrypoint to overwrite default if `CYGNUS_POSTGRESQL_ENABLE_CACHE` environment variable is set. * Amend Dockerfile to use COPY rather than bash cp. Note that `agent.conf` must be copied twice, since the docker-cygnus agent version is used if `CYGNUS_MULTIAGENT` is not set.
Member
|
Hi @jason-fox, It seems that your PR has introduced a failure in docker image creation: I guess that the problem is: COPY should be before RUN command. Could you fix that? Thanks! |
Contributor
Author
|
Whoops - I'd left a line concatenation hanging on the committed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have been attempting to run a Dockerized Cygnus to connect to a Postgres database. The changes in this PR enable me to do so.
Currently when I docker-compose using default values, I can't successfully add any data to Postgres since I get the #1467 issue. This is because the default value (
postgresql-sink.backend.enable_cache = false) causes a null pointer error since the cache is uninitialized.A value for
postgresql-sink.backend.enable_cachedoes not exist in theagent.confwhich is copied over when the entrypoint point is run, and no environment variable exists to override it, therefore I'm stuck with the broken default value without creating my own custom Docker file.This amendment adds the default value (
false) to the Dockeragent.confand ensures that the dummy fileagent.confin the same folder as theDockerfilegets copied into the image correctly. Note thatagent.confmust be copied twice , since the docker-cygnus agent version is used ifCYGNUS_MULTIAGENTis not set. The default value can be overwritten using an environment variable (CYGNUS_POSTGRESQL_ENABLE_CACHE)The
entrypointhas been amended to copy the external configuration files into the container using the DockerCOPYcommand rather than copying the internal files from within the downloaded github repository using the bashcpcommand. This allows a user to more easily override the default dummyagent.confwith their own files regardless of whetherCYGNUS_MULTIAGENTis set.Using Docker
COPYis preferred, since ordinary users won't have push rights to the git repo - see #1418 which proposes similar changes.