Comments (3)
We don't currently support linking because it assumes that things are running on the same host and we don't really have anything like that. Everything we have here has their DB environment injected via environment variables at deployment time. You can almost achieve the same thing by:
- Giving your container a custom hostname that is not the docker server's hostname. (we don't support this, but it's a few minutes fix. I'm going to look at that now.) Currently this sets it to the docker server's hostname which is problematic.
- Deploying your database container to a known port
- Setting an environment variable in your Centurion config for the service telling it the name of the Docker host and the known port. You can use the
%DOCKER_HOSTNAME%
special interpolation in the environment variable. So your config for the service would be something like:
set(:container_hostname, 'my-container')
env_vars DB_SERVER: "%DOCKER_HOSTNAME%:12345"
That will interpolate the docker server's hostname into the env var, and assumes your DB is running bound to port 12345.
Of course, if you want first class linking, it would be totally reasonable to add it. But it needs to go into the API calls.
from centurion.
This branch: https://github.com/newrelic/centurion/tree/setting-hostnames allows you to set the hostname inside the container. Give it a shot and I'll merge if it solves your need. You just:
set(:container_hostname, 'my-container')
from centurion.
Great thank you @relistan. I will give it try a let you know.
You're right, in my use case I'm having all on the same server but after having read your comment, I just think that I only have to define the server IP as localhost and that's all :)
Thank you again, I'll let you know.
from centurion.
Related Issues (20)
- Enhance centurion API to allow for gated deployment HOT 5
- Idea: Deployment API hooks HOT 8
- hostname does not match the server certificate HOT 5
- Optional port number HOT 1
- Deployment behind firewall HOT 7
- Volumes from "parent" problem. HOT 4
- Undeploy/kill action HOT 4
- Deploying a Specific Tag HOT 2
- trouble deploying to Docker host (centurion = 1.7.2, Docker host = 1.7.1) HOT 6
- is Registry 2.0 unsupported? HOT 4
- Exporting variables locallay HOT 1
- Dynamic Hosts Support HOT 1
- --override-env doesn't accept envvars with = in the value HOT 2
- Centurion Logging Environment Variable to Stdout HOT 1
- host-networked services without defined port mappings don't get health checked HOT 2
- set :no_pull doesn't work afaik HOT 1
- I want to add my own rake tasks. Not sure where to put db.rake file HOT 1
- Regular `deploy` task still stops containers in serial
- deploy:repair doesn't utilize custom health check method HOT 1
- Document how to specify networks for a container
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 centurion.