If you are here, it's probably because you either updated version of Docker Desktop or Rancher Desktop (or any application that runs Docker containers) and all the sudden a container, in my case redis-commander and you can't figure out why.
I want to be clear, that could be other exotic issues, but the majority of times, and this is not specific to Redis Commander to be fair, the reason is because that specific image was build with a different platform.
If you look at the Dockerfile in that specific project, you will see that it start with this:
FROM alpine:3.21
And if you look at what alpine is, it's just a minimal linux image, with basic support, but by default is built using the amd64
architecture.
And to be clear, there's nothing wrong about it, it's just the default CPU architecture as it's the most common.
But there's the issue if you have an Apple Silicon like me, like any M* processors from Apple.
And when you start docker with the default image like the Alpine one, it will try to run a container that was build from a different architecture than the one your computer is running. Is like to ask to a Japanese person, that doesn't speak any english, to read an english book. He knows what a book is, he knows that's something written there, but it can't understand it.
But don't worry, there's a simple solution. In docker you can just tell that, that specific image, it's written in a different architecture, so it can run it properly, using the platform
flag.
So if you want to run Redis Commander with Docker (or any image that has the same issue) with Apple Silicon, you should running like this:
docker run -d \
--name redis-commander \
--hostname redis-commander \
--platform linux/amd64 \
--restart always \
-e REDIS_HOSTS=local:redis:6379 \
-p 8081:8081 \
ghcr.io/joeferner/redis-commander:latest
Notice the --platform linux/amd64
, that's the line that tells Docker to run it with that specific platform, and not the native one of your computer.
Top comments (0)