<p>I'm trying to deploy a docker container with a python app to Azure Kubernetes Service. After deploying and looking at the logs on the new pod, I see this error:</p>
<blockquote>
<p>exec /usr/bin/sh: exec format error</p>
</blockquote>
<p>I'm building the container on a mac using the following docker buildx command:</p>
<pre><code>docker buildx build --platform linux/x86_64 -t &lt;my username&gt;/ingest .  
</code></pre>
<p>My Docker file has the following header</p>
<pre><code>FROM --platform=linux/x86_64 python:3.11
</code></pre>
<p>My deployment yaml looks like the following and seems to pull the image just fine.(I just used something from the azure documentation as a template.)</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: ingest
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      bb: ingest
  template:
    metadata:
      labels:
        bb: ingest
    spec:
      containers:
      - name: ingest
        image: &lt;my username&gt;/ingest:0.0.1
        imagePullPolicy: Always
</code></pre>
<p>When I inspect the images locally, I see</p>
<pre><code>&quot;Architecture&quot;: &quot;amd64&quot;,
&quot;Os&quot;: &quot;linux&quot;,
</code></pre>
<p>I'm was assuming that the default chip architecture is x86_64, but not sure. I also built the image with default chip architecture and OS and tested locally - it works fine. I'm new to K8 and Azure. Maybe, I'm missing something obvious. Is there a way to specify the chip architecture and the OS for in my configuration? If I don't specify it, what is the default?</p>

Sanjeev
<p>Below error will come when an container is getting executed in an architecture which are not built for.</p>
<blockquote>
<pre><code>exec /usr/bin/sh: exec format error
</code></pre>
</blockquote>
<p>The default value will be the value of os arch where buildkit is running.  More details how to build images for other arch is explained in <a href="https://docs.docker.com/engine/reference/commandline/buildx_build/#platform" rel="nofollow noreferrer">docker buildx documentation</a>.</p>
<p>In your case you can use below which build image for arm64(mac os AArch64) and x86 arch</p>
<pre><code>docker buildx build --platform=linux/amd64,linux/arm64
</code></pre>
