Giter Club home page Giter Club logo

Comments (3)

relistan avatar relistan commented on September 18, 2024

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:

  1. 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.
  2. Deploying your database container to a known port
  3. 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.

relistan avatar relistan commented on September 18, 2024

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.

zedtux avatar zedtux commented on September 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.