An OCI image index can point to separate image manifests for different operating-system and processor combinations, including linux/arm64 and linux/amd64 (OCI Image Index specification). If your Apple Silicon Mac runs the wrong image, first separate the service’s runtime target from the build’s output targets: check platform for the service, then check whether build.platforms includes the platform you need.

This is for you if you use Compose on an Apple Silicon Mac and need to pull or run an amd64 image, maintain a service with both image and build, or support arm64 and amd64 development environments. If you only need a general introduction to containers, the platform settings covered here may not be the issue you need to solve.

Apple Silicon Docker Compose platform settings control different decisions

Your Mac’s processor architecture does not automatically decide the target for every service in a Compose file. The service-level platform setting declares the platform the service image must target. The build.platforms setting identifies the target platforms for build output. The Compose service specification documents the service setting for pulling and building, while the Compose Build Specification defines the build platform list (service definition, build specification).

That distinction matters because a platform setting is not a conversion step. It does not rewrite an existing image’s executable files or turn a single-architecture image into a multi-architecture one. It requests or selects a target. The image available from the registry—or the build output—still has to match that target.

Use this quick comparison before editing YAML:

Compose situation Setting to inspect first What to verify Fit score
The service declares only image Service-level platform Whether the selected image has the requested OS and architecture Strong fit for pull-only use
The service declares image and build pull_policy, platform, and build Whether Compose pulls or builds, and whether the chosen image matches the target Conditional; source selection matters
The service is built for multiple targets build.platforms plus service platform Whether the build target list covers the service’s runtime platform Strong fit when the targets agree
The service has no explicit platform Resolved Compose configuration and actual image Whether the default selection matches your intended runtime Conditional; do not assume from the Mac alone

The fit scores are editorial assessments of how directly each configuration answers the stated need. They are not performance scores.

When a service declares only image

For an image-only service, Compose has no local build definition to use for that service. The service-level platform tells Compose the target platform for the service image. For example, platform: linux/amd64 requests an amd64 Linux image for that service. If you omit the setting, do not infer the selected image architecture just from the fact that the host is an Apple Silicon Mac; inspect the resolved configuration and the actual image instead. The service specification describes the role of platform in determining the service image target.

A registry image may be represented by an image index that points to platform-specific manifests. The index’s platform descriptors distinguish the operating system and architecture of the referenced images. If the index has no entry for your requested target, changing the Compose field cannot create one. You need an image that was published for that platform, or a build that produces it.

Check the image’s platform metadata rather than relying on its tag name. After pulling the service image, use docker image inspect to read the image’s OS and architecture fields; the command reference documents the image inspection output (docker image inspect).

For example, after resolving the image name and tag from your Compose file:

docker compose pull api
docker image inspect example-image:tag \
  --format '{{.Os}}/{{.Architecture}}'

Replace api and example-image:tag with the service name and the image reference used in your project. Compare the output to the platform you actually need, such as linux/arm64 or linux/amd64.

A tag identifies an image reference, not a guarantee that the image contains the architecture you expect. Inspect the selected image before treating a successful pull as proof of a platform match.

If you need only one service to use amd64, set platform: linux/amd64 under that service rather than changing the target for every service. Then check the pulled image’s metadata. This can request an amd64 image, but it cannot make a missing amd64 manifest available.

When a service declares both image and build

A service with both image and build needs a source check before you diagnose architecture. Compose can use an image reference and a build definition in the same service, but the resulting behavior depends on the service’s pull policy and configuration. The service reference documents pull_policy and the service’s image and build fields; use those definitions instead of assuming that the presence of build means Compose always rebuilds.

Treat these as separate questions:

  • Which image source is Compose using? Review image, build, and pull_policy. If Compose uses a pulled image, inspect that image. If it builds locally, inspect the build output.
  • Which platform does the service request? Check the service-level platform.
  • Which platforms can the build produce? Check build.platforms and compare the list with the service runtime target.

The second table shows how those checks affect the next action:

Observed configuration or result Likely decision point Next check Fit score
Compose pulls the image, but the image metadata is not the requested architecture Image selection or available image manifests Confirm the resolved image reference and inspect its OS/architecture Strong fit for a pull-side mismatch
Compose builds the service, but the output does not match platform Build target coverage Compare service platform with build.platforms, then inspect the built image Strong fit for a build-side mismatch
The file declares both image and build, but the source is unclear Pull-versus-build behavior Inspect pull_policy and the output of Compose configuration resolution Conditional until source is confirmed
Image metadata matches, but the service still fails at runtime Runtime or application compatibility Check the container’s image ID and the specific runtime error Weak fit for a Compose platform mismatch alone

A configuration inspection helps reveal the effective Compose model before you change settings. Run:

docker compose config

The command renders the Compose configuration after resolving and normalizing the model (docker compose config reference). Review the service’s image, build, platform, pull_policy, and build.platforms values in that output. This tells you what Compose has resolved from the files and environment, but it does not prove which image your running container uses.

If the service uses a pulled image, verify the image that was pulled. If it uses a build, build the service and inspect the result. The Compose build command reference describes how to build services from a Compose file (docker compose build). Do not use an image tag alone to conclude that the running container came from the latest local build; verify the image ID used by the container.

Multi-platform builds must cover the service runtime target

build.platforms is the build target list, not a substitute for the service’s runtime setting. The Compose Build Specification describes platforms as the target platforms for a build and documents the compatibility requirement when the service platform is specified. In practical terms, if a service is expected to run as linux/amd64, its build output must include linux/amd64 when building it for that target.

Do not assume an unlisted platform will be added automatically. Read the resolved configuration and the build result. If you maintain a service for both Apple Silicon development and amd64 deployment, decide whether you need one target for local testing or multiple outputs for different environments. Then make the service runtime target and the build target list agree with that decision.

A compact decision rule:

  • If you only need to run an existing image, verify the service platform and the pulled image metadata.
  • If you need to build and run one target, make the build output cover the service platform.
  • If you need arm64 and amd64 outputs, list the required build targets and verify that the resulting image contains the expected platform entries.
  • If the file resolves correctly but the service still fails, continue to runtime and application checks instead of repeatedly changing platform fields.

Docker’s multi-platform build guide explains the broader relationship between build targets and platform-specific images (multi-platform build documentation). This article stays focused on Compose service fields: the key decision is whether the platform requested by the service is among the targets the build is meant to produce.

Verify the resolved file, built image, and running container

Use this sequence to avoid stopping after a YAML edit. Each check answers a different question: what Compose resolved, what the build produced, and what the running container actually uses.

First, inspect the resolved Compose model. Run docker compose config and check the relevant service’s platform, image, build, pull_policy, and build.platforms values. If the resolved file does not show the target you intended, correct the Compose file, override file, or environment input that supplies the setting.

Next, decide whether the service should pull or build. Use the service configuration and its pull policy to identify the expected source. Do not treat a tag as evidence that the service is using a local build, and do not assume that a build definition rules out pulling.

Then, check build target coverage. If the service is built, compare its runtime platform with the build.platforms list. When the list omits the service target, align the settings with the intended output before deciding that the runtime is at fault.

Build or pull the intended image. Use docker compose build SERVICE for a service that should be built, or docker compose pull SERVICE when you want to verify the registry image. Keep the service name explicit so you do not mistake another service’s result for the one you are diagnosing.

Inspect the image metadata. Use docker image inspect and compare the OS and architecture fields with the requested platform.

Finally, inspect the image used by the running container. Retrieve the container’s image ID and inspect that image:

docker container inspect SERVICE \
  --format '{{.Image}}'

docker image inspect IMAGE_ID \
  --format '{{.Os}}/{{.Architecture}}'

The first command reports the image ID associated with the container; the second checks that image’s platform metadata. See the docker container inspect reference for container inspection details. If the container uses an unexpected image ID, recreate it through the intended Compose workflow and verify again.

A correct Compose file is only the first checkpoint. If you change platform or build.platforms but do not confirm the built or pulled image and the container’s image ID, you have not verified the final runtime artifact.

This sequence also helps separate three different failures. A resolved setting that differs from your intent points to Compose configuration. A matching request with no corresponding image architecture points to image availability or build output. A matching image platform with a runtime failure points to a later runtime or application check; the platform field alone does not diagnose that failure.

FAQ

Does platform affect pulling or building?

For a service that only declares image, the service platform affects the target image Compose selects or requests. When the service also declares build, the service platform is relevant to the build target as well. The build’s platforms list remains a separate setting, so inspect it when you build. The answer depends on the service’s complete configuration, not on the host chip alone.

What if the service platform is missing from build.platforms?

Add the needed target to the build configuration or change the service target to one the build is meant to produce. Then rebuild and inspect the output image. Avoid assuming that Compose silently fills the gap: the specifications describe the relationship between the service platform and build targets, so use the resolved configuration and actual build result to confirm compatibility.

How do I request amd64 for just one service?

Set platform: linux/amd64 on that service, then confirm the resolved Compose model and inspect the image used by the service. This setting asks for the target; it does not transform an arm64-only image. If Compose builds the service, check that the build configuration can produce amd64 as well.

How do I prove the build includes the service target?

Compare the service’s platform with build.platforms in the rendered configuration. Then build the service and inspect the resulting image’s OS and architecture. For a running container, inspect its image ID and inspect that image too. This confirms both the declared target and the artifact actually attached to the container.

Choose the test environment after confirming your target

Before changing machines, finish the platform checks against your service list: identify which services pull, which build, and whether each runtime target is covered by its image or build output. A local Apple Silicon setup can be the simplest option when your work targets arm64 and you can test the deployment architecture elsewhere. It becomes less representative when the failure appears only with amd64 images, when you need a clean test host, or when several developers must reproduce the same environment.

A remote Mac can provide a separate real-Mac environment for that verification, but it does not remove the need to confirm image architecture or build targets. It is a better fit for temporary isolation and cross-checking than for workloads that need a permanently owned machine, sustained heavy use, or direct access to physical hardware. If you want to compare that option with your current setup, review SSHMac’s service information and support guidance before choosing.

When a local Compose configuration gives you ambiguous results, rent a remote Mac from SSHMac for an isolated test run, then repeat the same configuration, image, and container checks. That gives you another real Mac environment to compare against without treating a platform field as proof that the final image is correct.