How to run Redis docker container for Mac Silicon?

Viewed 524

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

Here's the warning: enter image description here

I'm running this on an M1 Mac.

2 Answers
FROM redis:alpine
WORKDIR /usr/app
COPY conf/redis.conf /usr/local/etc/redis/redis.conf
EXPOSE 6379

The Dockerfile is built using docker-compose

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:

docker buildx build --platform=linux/amd64,linux/arm64 -t gitlab.netbuilder.io:5050/... .

You can inspect the image with commands like (replacing redis:alpine with your own image):

docker buildx imagetools inspect redis:alpine
Related