title: How to pass parameters between Multiple containers using docker-compose
body: <p>Hi i am trying to understand docker compose and how to pass parameters between the containers so that i can use it in my application.</p>
  
  <p>I have built a simple hello world application using two micro services </p>
  
  <p>The first micro-service is using java:</p>
  
  <pre><code>//java code hello.java
  public class hello
  {
      public static void main(String args[])
     {
         System.out.println("hello world from java");
     }
  }
  
  //Dockerfile for creating this image 
  FROM java:7
  COPY hello.java .
  RUN javac hello.java
  CMD ["java","hello"]
  </code></pre>
  
  <p>Similarly for the image using python i have two files:</p>
  
  <p>hello.py</p>
  
  <pre><code>print("hello from python")
  </code></pre>
  
  <p>Dockerfile for this image is:</p>
  
  <pre><code>FROM python:2.7
  COPY hello.py .
  CMD ["python","hello.py"]
  </code></pre>
  
  <p>my docker-compose file:</p>
  
  <pre><code>javacl:
    build: .
    links: pythoncl
  pythoncl:
    build: ./pythonfolder
  </code></pre>
  
  <p>What i want to do is to pass parameters , which i would be taking from the user in the java program and then want to pass that parameter to the python program and then display it. It is just an example app as i am trying to understand how can i pass parameters between containers</p>
  
  <p>I have seen the docker website which has a python app as an example, but any one could please use a java program and a python program and then could simply show as how to pass parameters with a very simple example.</p>
  
  <p><strong>One solution is to pass the parameters through the network as all containers have there own network stack, but are there any alternatives for passing the parameters</strong>.</p>
  
  <p>I am new to docker and any help would be great.</p>