containers / containers/podman-compose
podman-compose doesn't support `platform` option
- Dominant language
- Python
- Stars
- 6.2k
- Forks
- 622
- PR merge metrics
- No merged PRs in 30d
Description
## Is your feature request related to a problem? Please describe.
podman-compose ignores the [platform option](https://docs.docker.com/compose/compose-file/#platform) in the compose YAML file.
I am trying to use this parameter to override the platform value for mysql docker image so it can run on Mac M1.
```
## docker-compose.yml
version: '3.9'
services:
mysql-db:
platform: linux/x86_64
image: mysql:8.0.23
command: mysqld --default-authentication-plugin=mysql_native_password
ports:
- 3306:3306
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=db
- MYSQL_USER=user
- MYSQL_PASSWORD=password
```
```
$ podman-compose up -d
```
```
['podman', '--version', '']
using podman version: 4.2.0
** excluding: set()
['podman', 'network', 'exists', 'my-service_default']
podman run --name=my-service_mysql-db_1 -d --label io.podman.compose.config-hash=123 --label io.podman.compose.project=my-service --label io.podman.compose.version=0.0.1 --label com.docker.compose.project=my-service --label com.docker.compose.project.working_dir=/Users/rishabmanocha/src/github.com/deliverr/my-service --label com.docker.compose.project.config_files=docker-compose-test.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=mysql-db -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=db -e MYSQL_USER=user -e MYSQL_PASSWORD=password --net my-service_default --network-alias mysql-db -p 3306:3306 mysql:8.0.23 mysqld --default-authentication-plugin=mysql_native_password
WARNING: image platform ({amd64 linux [] }) does not match the expected platform ({arm64 linux [] })
328bba2de1a48c977076d23784cb7c9e494ff7f1b6038a4312af52d795b80db9
exit code: 0
```
## Describe the solution you'd like
The generated podman run command should include --platform flag with the value provided.
## Describe alternatives you've considered
I took the `podman run` command output generated by the podman-compose and manually edited it to include the `--platform linux/linux/x86_64` option and it worked for now.
## Additional context
Device is Mac M1 Pro.
Contributor guide
Assessment
This issue has not been assessed yet.