title: How do I import and run a multi-platform OCI image in Docker for macOS?
body: <p>I have a go web service that I've been building with <code>docker build</code> and running with <code>docker run</code> on my M1 Mac and on various Linux machines for a while. It's a simple binary installed on a <a href="https://github.com/GoogleContainerTools/distroless" rel="nofollow noreferrer">distroless</a> base and works great. Now I want to make a multi-platform image export to send to co-workers to run on their computers (M1 and Intel Macs). I've made an OC export like so:</p>
  <pre><code>docker buildx build --platform linux/amd64,linux/arm64 -t toy -o type=oci,dest=toy.oci .
  </code></pre>
  <p>And importing works fine:</p>
  <pre><code>docker image import toy.oci toy
  sha256:02f7342d9d6ec2a1b66440aedb8d9a6ae0e968373fc8f2b698f7c8e73e6747e0
  </code></pre>
  <p>Running it is another matter:</p>
  <pre><code>docker run -d --name toy -p 4242:4242 toy:latest
  docker: Error response from daemon: No command specified.
  See 'docker run --help'.
  </code></pre>
  <p>This is odd, because my Dockerfile has an <code>ENTRYPOINT</code>. Whatever, I try to tell it the command to run:</p>
  <pre><code>docker run -d --name toy -p 4242:4242 toy:latest /bin/toy
  docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: &quot;/bin/toy&quot;: stat /bin/toy: no such file or directory: unknown.
  </code></pre>
  <p>It's almost as if the container has no files in it! <code>docker image ls</code> shows my 32MB image, so I know there's something there, but where is it? Is there a layer missing?</p>
  <p>FWIW I tried <code>type=tar</code>, too, and got the same result.</p>
  <p>I assume I'm missing a step, but my DuckDuckGo-foo fails me. How does one build exportable multi-platform Docker images that actually work?</p>