Cannot deploy Flask app from Docker image

Hi, I am trying to deploy a Flask app for first time, using docker, but I am having issues. After some seconds, the deployment fails, and logs do not give much detail:

Application exited with code 1. This usually indicates an application failure. Check that the command used to launch your application is correct.

In order to provide more details, this app connects to a Postgres DB created within my Koyeb account. On the other hand, I have ran the docker image in local and everything seems to be working.

I cannot find a way to see what failed inside the docker container during the deployment, so I don’t have a clue what is the problem.

I have tried both, using the web and the koyeb cli, but any of them succeed. And I am using a free instance type

Finally, If it helps, the full log trace is the following:

type oInstance created. Preparing to start...
Instance is starting. Propagating network configuration...
Network configuration propagated
standard_init_linux.go:228: exec user process caused: exec format error
Application exited with code 1. This usually indicates an application failure. Check that the command used to launch your application is correct.
Instance stopped

Could anyone help with this?

I could finally fix it.

I was wrong, and logs were actually giving the information. Concretely:

standard_init_linux.go:228: exec user process caused: exec format error

After a quick search I finally found that this means the platform for which I built the Docker image was incompatible. So I Just needed to re-do a docker build with the flag --platform linux/amd64 and worked like a charm.

1 Like

Hi @Francisco_Gonzalez,

I’m glad to hear you’ve found a solution. Just so you know, our Platform supports building Docker images directly. Simply include a Dockerfile in your repo, and you’ll enjoy a few advantages:

  • Automatic builds for the correct platform, eliminating exec format error issues.
  • Faster push/pull with our local registry, speeding up app updates.

Alternatively, switching to Buildpack could further reduce build times thanks to aggressive caching.

Find out more about these options in our docs: How We Build from Git | Koyeb.

Hi @Lukasz_Oles ,

Thank you very much for your advise.

Unfortunately my code is not on Github at the moment. I have read about the option of adding support for Gitlab and Bitbucket into the roadmap, and have voted for both, so I will keep an eye on it.

1 Like