I'm running this on an M1 Mac.
CodePudding user response:
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
CodePudding user response:
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