Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Adds addon env to addon image #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Adds addon env to addon image #129

wants to merge 1 commit into from

Conversation

boboldehampsink
Copy link
Contributor

Some addons need env vars on their own image too, to run independently. An example is mysql, which needs at least MYSQL_ROOT_PASSWORD on its on image, see: https://github.com/docker-library/docs/tree/master/mysql#environment-variables

This fix adds the addon env vars to the addon image, fixing this

@busbyjon
Copy link

busbyjon commented Oct 7, 2015

👍

@friism
Copy link
Contributor

friism commented Oct 14, 2015

testing this now...

@friism
Copy link
Contributor

friism commented Oct 14, 2015

@boboldehampsink this is not a great solution because it adds the same env to all entries in docker-compose.yml. It's only only needed in the cleardb:

web:
...
  environment:
    PORT: 8080
    MYSQL_DATABASE: cleardb
    MYSQL_ALLOW_EMPTY_PASSWORD: yes
    CLEARDB_DATABASE_URL: 'mysql://root:@cleardb:3306/cleardb'
  links:
    - cleardb
...
cleardb:
  image: mysql
  environment:
    MYSQL_DATABASE: cleardb
    MYSQL_ALLOW_EMPTY_PASSWORD: yes
    CLEARDB_DATABASE_URL: 'mysql://root:@cleardb:3306/cleardb'

Should we add this as an attribute on the image so that addons.js would look like this:

  'cleardb': {
    image: { 
      name: 'mysql',
      env: {
        'MYSQL_DATABASE': 'cleardb',
        'MYSQL_ROOT_PASSWORD': 'my-secret-pw'
      }
    },
    env: {
      'CLEARDB_DATABASE_URL': 'mysql://root:my-secret-pw@cleardb:3306/cleardb'
    }
  }

/cc @hunterloftis

@boboldehampsink
Copy link
Contributor Author

Yeah that might be better

@friism
Copy link
Contributor

friism commented Oct 14, 2015

@boboldehampsink do you have time to look at this? I know that this is asking a lot, and it's really on Heroku to make these improvements.

@boboldehampsink
Copy link
Contributor Author

Sure, i'll try to find some time. Can you assign it to me then?

@friism friism assigned friism and unassigned friism Oct 14, 2015
@friism
Copy link
Contributor

friism commented Oct 14, 2015

Hm, don't think I can - probably because you're not in the Heroku org.

@boboldehampsink
Copy link
Contributor Author

Ahh ok, would be cool if that were possible on GitHub ;-)

jgkim added a commit to jgkim/heroku-container-tools that referenced this pull request Dec 3, 2015
jgkim added a commit to jgkim/heroku-container-tools that referenced this pull request May 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants