Docker on Heroku

March 2013

Docker open sourced

 

May 2015

Heroku released beta support for Docker

 

October 2017

Docker on Heroku Generally Available

 

November 2018

Added support for heroku.yml and review apps

How to

Container registry

https://devcenter.heroku.com/articles/container-registry-and-runtime

heroku.yml

https://devcenter.heroku.com/articles/build-docker-images-heroku-yml

build:
  docker:
    web: Dockerfile

release:
  image: web
  command:
    - bundle exec rake db:migrate

run:
  web:
    image: web
  worker:
    image: web
    command:
      - bundle exec sidekiq --config config/sidekiq.yml

heroku.yml

$ heroku stack:set container

+ auto deploy or

$ git push heroku master
run:
  web: bundle exec rake assets:precompile

Quirks

release:
  image: web
  command: bundle exec rails db:migrate
release:
  image: web
  command: 
    - bundle exec rails assets:precompile
    - bundle exec rails db:migrate
setup:
  addons:
    - plan: heroku-postgresql
      as: DATABASE
  config:
    S3_BUCKET: my-example-bucket

Quirks

Quirks

Quirks

  • Pipeline promotion is not supported yet
  • Runtime ENV not available during build
  • Docker commands not available:
    • VOLUME
    • EXPOSE
    • STOPSIGNAL
    • SHELL
    • HEALTHCHECK

Use cases?

Docker on Heroku

By Jan Dudulski

Docker on Heroku

  • 133