Comments (4)
Hello @simongareste ,
Indeed, by default, on docker, environment variables are not exported.
As explained in https://hub.docker.com/r/discoverycriteo/consul-templaterb, you have to run it with docker with docker run --env CONSUL_HTTP_ADDR=$CONSUL_HTTP_ADDR -p 8080:80/tcp discoverycriteo/consul-templaterb
in your case (since $CONSUL_HTTP_ADDR
contains the server you want to reach.
The reason why it works without docker is that consul-templaterb uses by default CONSUL_HTTP_ADDR
from the environment unless you use the flag -c
. If the flag -c
is not specified and CONSUL_HTTP_ADDR
is not present either, then, it will use by default http://localhost:8500
.
I am gonna check for the issues you mentioned: about navBarDecorator
and fetchedResponseDecorator
. (It is a plugin system we are using internally at Criteo, so, it migt be a little bit less tested). Still, is the UI correctly responding or does it breaks everything?
from consul-templaterb.
Indeed, thank you for you bug report: there was a bug fixed by 3a1dea9 (a missing resource containing the decorator) in the Dockerfile.
I released a new Docker version 1.26.2 - should work on your machine now.
I will work with this new version, human tested a few seconds ago!
Sorry for such lame bug (to be fair, we don't use docker for this app in our real-world deployments, that's why).
To test again:
docker pull discoverycriteo/consul-templaterb
and run again with:
docker run --env CONSUL_HTTP_ADDR=$CONSUL_HTTP_ADDR -p 8080:80/tcp discoverycriteo/consul-templaterb
Thanks a lot for the bug report and feel free to create Pull Request if you modify the templates and want your changes included in the default version.
You can also have a look at https://github.com/criteo/consul-templaterb/blob/master/samples/consul-ui/decorators.js.erb to customize your UI (for instance, linking some metadata of your Consul nodes/services with internal services of yours).
from consul-templaterb.
Hi,
Indeed, with the javascript fixed it works as expected (I wasn't clear in my previous post, I did had everything working in the container, except the view displayed in my browser - the files were all valid, my env variable was correctly interpretated).
However, I believe you still have an issue in the repository, as the Gemfile.lock provided here states
BUNDLED WITH
2.1.4
whereas the docker image ruby:2.5 comes with bundler 1.17.2. Because of this, building the image by directly building the Dockerfile upon clone won't work :
[...]
Step 5/10 : RUN bundle install
---> Running in 6507a122ed1f
You must use Bundler 2 or greater with this lockfile.
The command '/bin/sh -c bundle install' returned a non-zero code: 20
I see a few options to fix this:
- update rubygems in the Dockerfile before running bundle install:
RUN gem update --system
. This leads to a warning (Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running gem install bundler:2.1.4.
), but compiles successfully, and works (my consul-ui is working fine) - do not ship the Gemfile.lock in the image, by adding Gemfile.lock to the .dockerignore file (or even remove the Gemfile.lock altogether). This would lead to a variation of gems in the image, depending on the time/date of the build, which may or may not be a super idea. May I suggest, however, to lighten the image and speed up the build by removing everything that is not necessary, starting with the .git folder and a few others files? I can do a pull request for this one.
- upgrade the ruby image used, to one that is using the same bundle version as the one in your Gemfile.lock. This looks messy.
- rebuild and recommit the Gemfile.lock with a 1.17.x version.
- other options: I'm pretty sure there are a lot more options, these are the simplest that come to mind :)
from consul-templaterb.
@simongareste Arf... dependencies management with Ruby... I'll have a look, thank you!
Since you seem to know more than I do about dependency managemen with Ruby and Docker, would you like to create a Pull-Request?
from consul-templaterb.
Related Issues (20)
- Createing multiple files from one template
- Throttle EM requests to max/sec or max parallel? HOT 3
- Improve Docker image builld HOT 2
- Getting timestamp in templates HOT 5
- Executing command on each change HOT 2
- Get checks by state HOT 6
- Trying to auth to vault with certs HOT 3
- Signal Handling from Orchestrator HOT 9
- Expose list of templates objects being generated HOT 3
- undefined method `[]' for #<Consul::Async::ConsulTemplateNodes:0x000055744a631640> HOT 10
- inactivity_timeout for the vault endpoint isn't configurable/too short HOT 2
- [FEATURE] Prometheus Endpoint for Template Rendering Times HOT 2
- `ready?` method for remote_resource.as_json is always true HOT 2
- Eventmachine Seg Fault When Using Vault HOT 5
- [Q] AIX 7.1 Support HOT 1
- Potential Memory Leak HOT 13
- consul_templaterb uses deprecated methods HOT 3
- Correct usage of --wait-signal option HOT 2
- Question: How can we dynamically generate different templates from a consul K/V JSON object ? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from consul-templaterb.