title: How to add files in docker container volume on build time
body: <p>I have a python and java app that I want to run inside a container.
  I have a folder named <code>pass-hash</code> with:
  --<code>h2o-start</code> folder containing <code>Dockerfile</code> that I use to start <code>h2o.jar</code>which starts a server for machine learning.
  --<code>model-generator</code> folder containing <code>passhash.py</code> and a <code>data.csv</code> file.
  The <code>passhash.py</code> app contains <code>h2o.import_file("/var/my-data/data.csv")</code> which takes the <code>data.csv</code> file from the <code>my-data</code> folder I created in the container and generates a POJO file with it.
  The <code>h2o-start Dockerfile</code> contains:</p>
  
  <pre><code>FROM openjdk:8
  ADD h2o.jar h2o.jar
  EXPOSE 54321
  EXPOSE 54322
  ENTRYPOINT ["java", "-jar", "h2o.jar"]
  </code></pre>
  
  <p>The <code>model-generator Dockerfile</code> contains:</p>
  
  <pre><code>FROM python:2.7-slim 
  WORKDIR /model-generator 
  ADD . /model-generator 
  RUN mkdir /var/my-data 
  COPY data.csv /var/my-data 
  RUN chmod 777 /var/my-data/data.csv 
  RUN pip install --trusted-host pypi.python.org -r requirements.txt 
  EXPOSE 8080 
  ENV NAME World 
  CMD ["python", "passhash.py"]
  </code></pre>
  
  <p>The <code>docker-compose.yml</code> file contains:</p>
  
  <pre><code>version: "3"
  
  services:
  
     h2o-start:
      image: milanpanic2/h2o-start
      build: 
        context: ./h2o-start
      ports: 
        - "54321:54321"
        - "54322:54322"
      volumes:
        - "home/data"
  
     model-generator:
      image: milanpanic2/model-generator
      build:
        context: ./model-generator
      ports:
        - "8080:8080"
      depends_on:
        - "h2o-start"
      volumes:
        - "csvdata:/var/my-data" 
  
  volumes:
   csvdata:
  </code></pre>