<p><a href="https://i.stack.imgur.com/weYiW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/weYiW.png" alt="enter image description here"></a></p>

<p>Hi. First of all, I know that it can be some kind of duplication. But answers which I've fouds doesn't help me. Here is my case. </p>

<p>I want to create a deployment of my docker image by using GCP (GKE). I create it by using gke ui ( in workloads menu) . My image was created by docker file which you can see here :</p>

<pre><code>FROM keymetrics/pm2:latest-alpine

COPY dist dist/
COPY package.json .
COPY pm2.json .

RUN npm install --production

RUN ls -al -R

CMD [ "pm2", "start", "pm2.json", "-p", "3000:80" ]
</code></pre>

<p>I've started this image locally and it was working correctly. Here you can see it :</p>

<pre><code>sudo docker run booknotes-app

[PM2] Spawning PM2 daemon with pm2_home=/root/.pm2
[PM2] PM2 Successfully daemonized
[PM2][WARN] Applications booknotes-app not running, starting...
[PM2] App [booknotes-app] launched (1 instances)
┌───────────────┬────┬─────────┬──────┬─────┬────────┬─────────┬────────┬─────┬───────────┬──────┬──────────┐
│ App name      │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem       │ user │ watching │
├───────────────┼────┼─────────┼──────┼─────┼────────┼─────────┼────────┼─────┼───────────┼──────┼──────────┤
│ booknotes-app │ 0  │ N/A     │ fork │ 24  │ online │ 0       │ 0s     │ 0%  │ 22.9 MB   │ root │ disabled │
└───────────────┴────┴─────────┴──────┴─────┴────────┴─────────┴────────┴─────┴───────────┴──────┴──────────┘
 Use `pm2 show &lt;id|name&gt;` to get more details about an app
</code></pre>

<p>You can also see my pods list: </p>

<p><a href="https://i.stack.imgur.com/wmgCG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wmgCG.png" alt="enter image description here"></a></p>

<p>And also you can see logs of my crushed pod: </p>

<pre><code>kubectl logs booknotes-back-end-7f6766868f-5c92l
[PM2] Spawning PM2 daemon with pm2_home=/root/.pm2
[PM2] PM2 Successfully daemonized
[PM2][WARN] Applications booknotes-app not running, starting...
[PM2] App [booknotes-app] launched (1 instances)
┌───────────────┬────┬─────────┬──────┬─────┬────────┬─────────┬────────┬─────┬──────────┬──────┬──────────┐
│ App name      │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem      │ user │ watching │
├───────────────┼────┼─────────┼──────┼─────┼────────┼─────────┼────────┼─────┼──────────┼──────┼──────────┤
│ booknotes-app │ 0  │ N/A     │ fork │ 23  │ online │ 0       │ 0s     │ 0%  │ 3.2 MB   │ root │ disabled │
└───────────────┴────┴─────────┴──────┴─────┴────────┴─────────┴────────┴─────┴──────────┴──────┴──────────┘
 Use `pm2 show &lt;id|name&gt;` to get more details about an app
</code></pre>

<p>As you can see it looks the same as it looks locally. I've also tried to use solving from this response: </p>

<p><a href="https://stackoverflow.com/questions/49974003/i-got-pod-errors-crashloopbackoff-from-kubernetes">I got Pod errors: CrashLoopBackOff from kubernetes</a></p>

<p>I've added <code>tty: true</code>, but it didn't help me a lot. If you need additional info, pls let me know</p>

Andrey Radkevich
<pre><code>CMD [ "pm2", "start", "pm2.json", "-p", "3000:80" ] --&gt; CMD [ "pm2-runtime", "start", "pm2.json"]
</code></pre>

<p>The problem was in this line. </p>
