Dušan Maďar
Dušan Maďar

Reputation: 9839

Heroku and Docker BuildKit

https://devcenter.heroku.com/articles/build-docker-images-heroku-yml outlines how to build Docker images on Heroku.

However, it seems that Heroku runs a [very] old version of Docker because BuildKit doesn't work. I need BuildKit (works with Docker 18.09 or higher) to install a dependency from a private GitHub repo. Using RUN --mount=ssh ..., which is required to attach SSH keys while building the image, fails with

Dockerfile parse error line xx: Unknown flag: mount

and I wasn't able to resolve that (nope, adding # syntax=... to the top of the Dockerfile didn't work, same goes for DOCKER_BUILDKIT=1 env variable).

How to setup Docker BuildKit on Heroku? Or is it really not possible? Does someone know what Docker version runs on Heroku?

Upvotes: 3

Views: 239

Answers (1)

Cory
Cory

Reputation: 24240

I ran into the same problem and wasn't able to find any workaround.

In my case I was using the --mount command for optional caching, so I just got rid of that and was able to make it work.

Pretty sad that Heroku is running such an ancient Docker version that these features aren't usable! They do highlight some long lists of limitations associated with their container runtime.

Upvotes: 1

Related Questions