Host volumes / environment variables not available during container build stage

I have the following set up

Build options:
    --link dokku.postgres.xsacdb-database:dokku-postgres-xsacdb-database
    -v /storage/xsacdb/conf:/app/conf
    -v /storage/xsacdb/media:/app/media
Deploy options:
    --link dokku.postgres.xsacdb-database:dokku-postgres-xsacdb-database
    -v /storage/xsacdb/conf:/app/conf
    -v /storage/xsacdb/media:/app/media
Run options:
    --link dokku.postgres.xsacdb-database:dokku-postgres-xsacdb-database
    -v /storage/xsacdb/conf:/app/conf
    -v /storage/xsacdb/media:/app/media

However when pushing and triggering a build these directories are not accessible.

  • Using compose in (fabric8io) docker-maven-plugin deactivates image build
  • Access docker-machine VM ports without port forwarding
  • How to increase ulimit in Docker in Elastic Beanstalk?
  • How to run NodeJS command-line tools inside Docker?
  • How to automate a docker run from a private Dockerhub repo?
  • Closed Pipe error while doing sftp in vm using docker
  • ls: cannot access /app/conf: No such file or directory
    ls: cannot access /app/media: No such file or directory
    

    They are available once the container is built

    dokku run xsacdb bash
    $ ls /app/conf
    files here!
    

    My Dockerfile

    Edit

    In addition the DATABASE_URL environment variable set my the postgres plugin is also not available at build time.

  • Why do ping packets not reach a custom gateway in docker?
  • Is there a way to set the Docker container's mac address in docker-compose.yml file?
  • docker-compose persistent data on host and container
  • Bind-mount volume of different type from guest to host
  • Keep getting Could not read CA certificate when trying to start docker
  • Forever monitor fails to run inside a docker container [duplicate]
  • One Solution collect form web for “Host volumes / environment variables not available during container build stage”

    Docker build does not accept those parameters http://docs.docker.com/reference/commandline/build/

    dokku must just silently ignore them.

    I believe the only way to provide data to the dokku build is to put the files in the git repo.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.