Monthly Archive for: ‘June, 2018’

Heroku Docker Deployment Update

Last Friday I gave a presentation for the Java User Group Thüringen that included a live deployment to Heroku using Docker. The deployment did not work and I found out about it one day later: Heroku has changed the workflow, Docker push to the Heroku registry does not release the app anymore. The reason for that change is explained here. In my Travis-CI builds, I added a small bash script using the Heroku API to trigger a release. Here is an example script that I use in my microservice in 60 minutes demo.

imageId=$(docker inspect --format={{.Id}})
curl -n -X PATCH \
-d "$payload" \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.heroku+json; version=3.docker-releases" \
-H "Authorization: Bearer $HEROKU_AUTH_TOKEN"

Then, the .travis.yml script part looks like:

  - docker tag kaitoedter/ms60min
  - docker login --username=_ --password="$HEROKU_AUTH_TOKEN"
  - docker push
  - ./

Now, releasing Docker images after pushing them to Heroku is working again.