<p>I'm new with k8s and I've deployed a simple nginx deployment using eks and ecr. The problem only present when I'm using ecr image, it's not happens with nginx public image from docker hub.
Here is my deployment file.</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      imagePullSecrets:
        - name: *-ecr-registry
      containers:
        - name: nginx
          # image: nginx:latest
          image: *.dkr.ecr.*.amazonaws.com/nginx:dev
</code></pre>
<p>Here is output of a pod.</p>
<pre><code>Events:
  Type     Reason     Age                From               Message
  ----     ------     ----               ----               -------
  Normal   Scheduled  12s                default-scheduler  Successfully assigned *
  Normal   Pulled     10s (x2 over 12s)  kubelet            Container image * already present on machine
  Normal   Created    10s (x2 over 12s)  kubelet            Created container nginx
  Normal   Started    10s (x2 over 11s)  kubelet            Started container nginx
  Warning  BackOff    8s (x2 over 9s)    kubelet            Back-off restarting failed container
</code></pre>
<p>Here is result log of the pod</p>
<pre><code>exec /docker-entrypoint.sh: exec format error
</code></pre>
<p>I also ran the ecr image with docker in my local machine without any error.
Can someone give me some hints, how can I overcome this issue, thanks in advance.</p>

TanIkemen
<blockquote>
<p>The requested image's platform (linux/amd64) does not match the
detected host platform (linux/arm64/v8) and no specific platform was
requested</p>
</blockquote>
<p>it's due to you have built the Docker image on an <strong>ARM M1</strong> chip either on Mac and try to run it on <strong>AMD</strong> or the opposite due to that it's throwing an error.</p>
<p>You can build the docker image again by passing ARG <strong>--platform</strong></p>
<pre><code>--platform linux/amd64
</code></pre>
<p>Or you can also set the Environment variable <code>export DOCKER_DEFAULT_PLATFORM=linux/amd64</code></p>
<p>You can pass ARG with <strong>FROM</strong> in <strong>Dockerfile</strong> or while running command <code>docker build --platform</code></p>
<p><strong>Dockerfile</strong></p>
<pre><code>FROM --platform=linux/amd64 node
</code></pre>
<p><strong>ARG</strong> with build command</p>
<pre><code>docker build -t &lt;image-name&gt; --platform linux/amd64
</code></pre>
<p>ref doc: <a href="https://docs.docker.com/engine/reference/builder/#from" rel="nofollow noreferrer">https://docs.docker.com/engine/reference/builder/#from</a></p>
<p>You can also <strong>run</strong> the image with docker like</p>
<pre><code>docker run --platform linux/amd64 node
</code></pre>
