Verified Solution[docker/cli] docker swarm - support for platform property in compose
Sponsored Content
### ROOT CAUSE
The error occurs because the `platform` property in the Compose file is not recognized by the Docker CLI's compose parser. This is due to the parser not supporting Compose file version 3.9 or higher, which is required for the `platform` property.
### CODE FIX
1. **Update the Compose file version** to 3.9 or higher.
2. **Add the `platform` property** to the service.
Example `docker-compose.yml`:
```yaml
version: '3.9'
services:
ppo:
image: myimage
platform: linux/amd64
```
3. **Ensure Docker Engine and CLI are updated** to versions that support Compose file version 3.9 (Docker Engine 19.03.0+ and Docker CLI 2.0.0+).
This change allows the `platform` property to be recognized, resolving the deployment error.
Deploy on DigitalOcean ($200 Credit)
Related Fixes
[golang/go] build: build failure on go1.26-linux-arm64_c4as16-perf_vs_release
[facebook/react] Bug: React Compiler does not preserve HTML entity
[StackOverflow/docker] Cannot get npm installed app to be present in final Docker image