<p>This is my docker file</p>
<pre class="lang-sh prettyprint-override"><code>#!/bin/bash
FROM node:10.8.0 as build-stage
WORKDIR /app
COPY package*.json /app/
RUN npm install
COPY ./ /app/
ARG configuration=production
RUN npm run build -- --output-path=./dist/out --configuration $configuration
FROM nginx:1.15
#Copy ci-dashboard-dist
COPY --from=build-stage /app/dist/out/ /usr/share/nginx/html
#Copy default nginx configuration
COPY ./nginx-custom.conf /etc/nginx/conf.d/default.conf
</code></pre>
<p>I am getting error CrashLoopBackOff. When i try to find the log it says <code>exec /usr/sbin/nginx: exec format error</code>. How can i resolve this and get the app running</p>

<p>Try something like adding <code>--platform=linux/amd64</code> in your <strong>Dockerfile</strong></p>
<pre><code>FROM --platform=linux/amd64 node:18-alpine as builder
</code></pre>
<p>Build the image and run it on <strong>K8s</strong>.</p>
<p>it could be due to the building image on Mac or Arm and your K8s cluster is not supporting that architecture.</p>
<blockquote>
<p>The optional <strong>--platform</strong> flag can be used to specify the platform
of the image in case FROM references a multi-platform image. For
example, linux/amd64, linux/arm64, or windows/amd64. By default, the
target platform of the build request is used.</p>
</blockquote>
<p><a href="https://The%20optional%20--platform%20flag%20can%20be%20used%20to%20specify%20the%20platform%20of%20the%20image%20in%20case%20FROM%20references%20a%20multi-platform%20image.%20For%20example,%20linux/amd64,%20linux/arm64,%20or%20windows/amd64.%20By%20default,%20the%20target%20platform%20of%20the%20build%20request%20is%20used." rel="nofollow noreferrer">Doc ref</a></p>
