Fly deploy fails due to CMD missing from docker.

Hello, I am deploying a new app as I did hundreds of times… but this time around something new happened, my docker image get’s rejected because of a missing CMD, when it is present on the dockerfile:

ERROR: failed to launch: determine start command: when there is no default process a command is required

I runned:

$ fly launch
$ cat .env | fly secrets import --app uploader-XXX
$ fly deploy --app uploader-XXX --dockerfile dockers/Dockerfile.trades --no-cache

My Dockerfile:

FROM node:17

WORKDIR /app

COPY package.json package.json
COPY package-lock.json package-lock.json
RUN npm install

COPY . .

CMD node bin/XXX.js

Thanks in advance to anyone reading this.

1 Like

I’ve tested that exact Dockerfile with a “Hello World” express application without issue. So it doesn’t look like the problem is there. I suspect that the key phrase here is “no default process”. Both fly.toml and machines define “processes” (though they do so differently). I note you explicitly passing --app on the CLI. Can you explain more about your setup?

2 Likes

This sounds like a buildpack error. Which would mean your Dockerfile isn’t getting used. If fly.toml has a buildpack defined, this could be the problem.

You can try running LOG_LEVEL=debug fly deploy to see which config file is getting used, as well. It’s possible it’s using one you don’t expect.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.