docker build with a template Dockerfile

I am using travis to build artefacts (jars and zips) and store them on bintray. I want to build docker images that install these artefacts for example for the ‘app’ artefact at version 0.1.0, hash abc123:

FROM some-registry/oracle-jre7
RUN wget -O /opt/app.jar
CMD ["java", "-jar", "/opt/app.jar"]

Every time I want to create this docker image the hash (and maybe the version) will be different and I don’t want to use ‘latest’. I can easily generate the Dockerfile using a template in travis, but I’m not sure how to build the docker image. It seems I can’t build it on travis and and docker hub don’t have an api that I can post a Dockerfile or archive to (although you can do this through the ui on

  • Sending data from one pod to another pod running specifically on the same host (DaemonSet)
  • Docker Stack deployment in windows 10 can not start service
  • After Moving Laravel directory to parent, can't see files on Laradock workspace
  • Ruby Remote SDK configuration with Intellij broken - workarround?
  • creating staging environment locally on single host using docker
  • How can I run a docker container and commit the changes once a script completes?
  • I don’t want to get travis to commit the Dockerfile to a secondary git repo because that’s getting really complex to sync the two repos if they have multiple branches. I could also commit a Dockerfile like this to the main repo and then trigger or dockerhub to build after the artefact was created (if they could somehow evaluate the git hash):

    FROM some-registry/oracle-jre7
    ENV APP_GIT_HASH $(git rev-parse --short HEAD) # this definitely doesn't work
    RUN wget${APP_VERSION}_${GIT_HASH}.jar -O /opt/app.jar
    EXPOSE 9000
    CMD ["java", "-jar", "/opt/app.jar"]

    I am currently experimenting with putting a docker host in ec2 and getting travis to get it to build the docker image and push it to a docker repository on bintary, but I’d rather not have to manage the host myself.

  • Docker remote API not accessible
  • Docker changing /var/lib/docker/aufs/diff location
  • How to enable Docker API access from Windows running Docker Toolbox (docker machine)
  • On server startup NPM find start script
  • Docker private registry with multiple registry urls using nginx
  • Docker exec printf gives No such file or directory error
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.