Building with mix phx.gen.release --docker error: no match for platform in manifest

Hello all!

I’m upgrading an existing Phoenix App that used Distillery. I see now we’re using mix release. I have that aspect running fine. I ran mix phx.gen.release --docker to replace my existing Docker setup.

Inside the Dockerfile:

ARG ELIXIR_VERSION=1.16.2
ARG OTP_VERSION=26.2.4
ARG DEBIAN_VERSION=bullseye-20240423-slim

ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"
ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"

FROM ${BUILDER_IMAGE} as builder

When I go to run the generated Dockerfile I get:

Dockerfile:22
--------------------
  20 |     ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"
  21 |     
  22 | >>> FROM ${BUILDER_IMAGE} as builder
  23 |     
  24 |     # install build dependencies
--------------------
ERROR: failed to solve: hexpm/elixir:1.16.2-erlang-26.2.4-debian-bullseye-20240423-slim: no match for platform in manifest: not found

This is the directly generated Dockerfile and it’s stuck at building a variable? What am I missing?

It says “no match for platform”, which CPU arch are you on? Apple’s M-series?

I am. I see the debian version listed has arm64v8 support?

I don’t think Apple’s M-series arch is arm64v8 though? Isn’t it aarch64 or something? When you invoke uname -a, what do you see?

Darwin MDMBP.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64

Well then, there is a difference between arm64 and arm64v8 but I might be wrong. No further ideas, sorry.

1 Like

Thanks anyway!

For future travellers, I went this way:

ARG BUILDER_IMAGE="elixir:1.16.2-otp-26"
ARG RUNNER_IMAGE="elixir:1.16.2-otp-26"
2 Likes

Only thing I’ll add is that it looks like the intent of the original generated Dockerfile was to use a plain Debian “slim” image to run the release, which will likely yield a much smaller final image than running on the Elixir image.