Looking at the Redis image, https://hub.docker.com/_/redis, it says that it supports Arm64. However when I run the image on a Mac M1, it shows an AMD64
warning badge (i.e. poor performance due to Rosetta emulation)
How do I specify the ARM64 version of redis?
Here’s the Dockerfile:
FROM redis:alpine
WORKDIR /usr/app
COPY conf/redis.conf /usr/local/etc/redis/redis.conf
EXPOSE 6379
I’m running this on an M1 Mac.
2
Answers
You should use
arm64v8/redis
instead of the default. So, replace:For:
More info here:
https://hub.docker.com/r/arm64v8/redis
Alternatively, you can use the
--platform
arg or use theTARGETPLATFORM
, as explained here:https://nielscautaerts.xyz/making-dockerfiles-architecture-independent.html
You haven’t deployed the multi-platform redis image. You’ve deployed your own image built from that, and
docker-compose build
doesn’t create multi-platform images. If you build it locally on your M1, it should be an ARM64 image. If you want to build multi-platform images, then I’d switch to building with:You can inspect the image with commands like (replacing
redis:alpine
with your own image):