Why does it crash in Heroku using docker?

Trying to deploy the docker image on Heroku crashes with:

2025-06-24T14:29:37.124163+00:00 app[web.1]: 2025-06-24 14:29:37,001 INFO driver.impl :: Registered driver :mysql (parents: [:sql-jdbc]) ๐Ÿšš
2025-06-24T14:29:37.470141+00:00 app[web.1]: 2025-06-24 14:29:37,469 INFO driver.impl :: Registered driver :postgres (parents: [:sql-jdbc]) ๐Ÿšš
2025-06-24T14:29:41.975543+00:00 app[web.1]: 2025-06-24 14:29:41,975 INFO core.core ::
2025-06-24T14:29:41.975563+00:00 app[web.1]: Metabase v0.55.4 (7833c48)
2025-06-24T14:29:41.975563+00:00 app[web.1]: 
2025-06-24T14:29:41.975564+00:00 app[web.1]: Copyright ยฉ 2025 Metabase, Inc.
2025-06-24T14:29:41.975564+00:00 app[web.1]: 
2025-06-24T14:29:41.975565+00:00 app[web.1]: Metabase Enterprise Edition extensions are NOT PRESENT.
2025-06-24T14:29:42.158968+00:00 app[web.1]: Unrecognized command: '/bin/sh'
2025-06-24T14:29:42.159020+00:00 app[web.1]: Valid commands: version, help, drop-entity-ids, import, dump, api-documentation, load, seed-entity-ids, dump-to-h2, environment-variables-documentation, remove-encryption, migrate, config-template, driver-methods, load-from-h2, export, rotate-encryption-key, reset-password
2025-06-24T14:29:42.689201+00:00 heroku[web.1]: Process exited with status 1
2025-06-24T14:29:42.707118+00:00 heroku[web.1]: State changed from starting to crashed

I'm able to run the container locally, no worries.

Does anyone have any idea what it could be?

FYI's:
Running metabase/metabase:latest (also tried with v0.55.5, no difference)

# heroky.yml
build:
  docker:
    web: Dockerfile
run:
  web: /app/run_metabase.sh

Appreciate any pointers

The problem is:

Unrecognized command: '/bin/sh'

The base image used for your docker build is too minimal; there's no shell in it and Metabase wants one. I'm not familiar with Heroku, but see if they have another base image that's a bit more full-featured.

The DockerHub Metabase image has an appropriate base. That's the one I ran when I was demo-ing Metabase on Render.

Edit: This was on 0.54.x, not tried 0.55.x, in case Metabase mis-packaged their image or something.

1 Like

Weird. I'm using exactly the DockerHub Metabase image (which also works on my computer). So it doesn't appear to be a lack of deps in the base image.

The "Unrecognized command" seems to be coming from the metabase executable, at the end of the script ./run_metabase.sh (metabase/bin/docker/run_metabase.sh at master ยท metabase/metabase ยท GitHub)

This is the line returning the error metabase/src/metabase/cmd/core.clj at master ยท metabase/metabase ยท GitHub

BTW similar issue is mentioned in the thread Support for Heroku

UPDATE: in the mentioned thread, one of the suggestions worked for me.