Environment variables need to be better
FIGTEST_REDIS_1_PORT_6379_TCP_ADDR
This is ridiculous.
Oh no I meant the fig ones, http://orchardup.github.io/fig/django.html
I think they are probably out of date. The hostname was introduced to Docker after the environment variable approach.
Correct - I don't believe links created /etc/hosts entries back when Fig was launched.
I'd be interested in making that the default (along with a suffix-free link alias), if there aren't any hidden drawbacks.
:+1:
That's a :+1: for the idea. There probably are drawbacks, but I haven't thought about it too much.
I've run into my fair share of problems with this, so my $0.02 and workarounds:
-
Using the hostnames written into
/etc/hostsworks great except that with Fig they contain underscores for the prefix, which is technically not an allowed character in URLs, and ends up breaking URL parsers. -
To re-write the environment variables from what Fig provides to what my application expects in the real world, I have been using a custom
ENTRYPOINTthat does something like this:#!/usr/bin/env bash export REDIS_URLS="$REDIS_1_PORT" exec $@
hi, coming #342, I wanted to comment here, that the environment variables are defined by docker, and that's not something fig should try to change, it's a docker convention.
what fig decides (and ultimately impacts those env vars) is the container name. the _1 seems unnecessary, web container should be named web (and then the env vars would be named as in any other docker setup)
@stonefury this issue is not about the _1, but about using hosts instead of env vars, about getting rid the _1 I created #349
So in our environment we've run into a problem of multiple environment variables being created for the same thing.
We'll have something like
REDIS_PORT_6379_TCP_ADDR:6379 REDIS_1_PORT_6379_TCP_ADDR:6379 FIGTEST_REDIS_1_PORT_6379_TCP_ADDR:6379
Is this a fig problem or docker? It makes a lot of mess for the environment variables because we'll have like 20 environment variables that will all be replicated three times.
This is a Fig problem and it's for the sake of backwards compatibility. Perhaps we should phase these out over the course of a few releases. Or, we should just ship 1.0.0.
On Thu, Aug 14, 2014 at 10:56 AM, Connor Humphries <[email protected]
wrote:
So in our environment we've run into a problem of multiple environment variables being created for the same thing.
We'll have something like
REDIS_PORT_6379_TCP_ADDR:6379 REDIS_1_PORT_6379_TCP_ADDR:6379 FIGTEST_REDIS_1_PORT_6379_TCP_ADDR:6379
Is this a fig problem or docker? It makes a lot of mess for the environment variables because we'll have like 20 environment variables that will all be replicated three times.
— Reply to this email directly or view it on GitHub https://github.com/docker/fig/issues/37#issuecomment-52218435.
Thanks @aanand is a next release scheduled already?