I was having a problem to create a container on my mac because:
i am running Docker on an Apple Silicon Mac (ARM64 architecture), but my image is built for linux/amd64 (Intel/x86 architecture). This platform mismatch is causing the container to exit immediately with code 0.
the docker support team told me to :
The Solution
You have two options to resolve this:
Run the Image with Platform Emulation (Quick Fix)
Modify your docker-compose.yml to include the platform specification:
services: integrationtoolkit.api: platform: linux/amd64 # ... rest of your configuration
The [platform attribute documentation] explains that this defines the target platform the containers run on using the os[/arch[/variant]] syntax.
Build a Multi-Platform or ARM64 Image (Recommended)
The better long-term solution is to build your image for ARM64 architecture. You can either:
- Build specifically for ARM64:
docker build --platform linux/arm64 -t your-image-name . - Build a multi-platform image that works on both architectures:
docker buildx build --platform linux/amd64,linux/arm64 -t your-image-name .
Try Option 1 first by adding platform: linux/amd64 to your service in the docker-compose.yml file, then run:
docker compose up -d
And what i done :
I have tried to build a container from a docker.compose.yml file as follows :
1 first by adding platform: linux/amd64 to your service in the docker-compose.yml file
then Run :
docker compose up -d
I Got :
% docker compose up -d
[+] Running 1/1
integrationtoolkit.api Pulled 9.8s
[+] Running 1/1
✘ Container ecommerce Error response from daemon: image with reference egyptiantaxauthority/integrationtoolkit.api:3.1.3 was found but do… 0.0s
Error response from daemon: image with reference egyptiantaxauthority/integrationtoolkit.api:3.1.3 was found but does not provide the specified platform (linux/amd6)
so it doesn’t work unfortunately
And I can’t use the following command also,
docker buildx build --platform linux/amd64,linux/arm64
as it will tell me → no such file or directory as this is not a docker file it’s a docker.compose.yml
and i can’t for sure remove the compose.yml part and rename it to dockerfile only
so what to do please ???

