skip to Main Content

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


  1. You should use arm64v8/redis instead of the default. So, replace:

    FROM redis:alpine
    

    For:

    FROM arm64v8/redis:alpine
    

    More info here:
    https://hub.docker.com/r/arm64v8/redis

    Alternatively, you can use the --platform arg or use the TARGETPLATFORM, as explained here:

    https://nielscautaerts.xyz/making-dockerfiles-architecture-independent.html

    Login or Signup to reply.
  2. 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
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search