Docker-compose Kubernetes ENV properties interoperability

9/18/2015

I'm building my staging environment using docker-compose, with application that was previously ran in Google Cloud using Kubernetes.

My application was configured, using ENV properties provided inside Kubernetes container, and now after switching to docker-composite, I have different naming convention for linked services.

I can think of few solutions, for my problem:

  1. Change my application, to support alternative configurations, so it would support both docker-composite & Kubernetes
  2. Create aliases in docker-compose or Kubernetes so that configuration would always be available in single format in both environments, and I would not need to touch my application configurations.
  3. Maybe some other way, which I don't see

I want to go with the 2nd solution, but I don't know how exactly to configure it. Have ideas?

-- mavarazy
configuration
docker
docker-compose
kubernetes

1 Answer

9/21/2015

You could use the environment section to define 'docker-compose' variables like PARAM1=${PARAM2}. In this case, docker-compose will have the same variables that Kubernetes has.

-- Tomas
Source: StackOverflow