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:

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 quay.io 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 quay.io).

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 quay.io or dockerhub to build after the artefact was created (if they could somehow evaluate the git hash):

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.