web stats
Featured image of post Fix for Docker image problem with M1 processor

Fix for Docker image problem with M1 processor

How to fix incompatibility issues of some docker images with  M1 Processors

Using images with generic architectures in Docker can generate incompatibilities with M1 Silicon processors.

We can use the Rosetta virtualization layer to solve this kind of problems.

Method 1: export variable.

If we are using the CLI directly, we can export the following variable beforehand in the shell:

1
export DOCKER_DEFAULT_PLATFORM=linux/amd64

Method 2: correct docker-compose.

If we are using docker-compose, we modify it according to the file format:

1
platform: linux/amd64

For example:

1
2
3
kafka:
	image: confluentinc/cp-kafka:latest
	platform: linux/amd64

Method3: correct dockerfile:

Another option if what we use is a dockerfile:

1
2
ARG build_for=linux/amd64
- FROM --platform=$build_for python:3.9.13-slim AS base
Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo-Extended & theme Stack