containers / containers/podman-compose

podman-compose does not support windows devices in volumes mapping, incompatible with docker

Open
#600 11 comments 4 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
6.2k
Forks
622
PR merge metrics
No merged PRs in 30d

Description

I am running on Windows 10, using podman-compose 1.0.3. I also tested with 1.0.4 from the repository.

I have a docker-compose.yaml with the following volume mapping:
```
volumes:
- C:/users/jsparkes/sql_data:/sql_data
```
When I run `podman-compose up` I get an error message:
```
podman-compose version: 1.0.4
['podman', '--version', '']
using podman version: 4.3.1
Traceback (most recent call last):
File "C:\Users\jsparkes\sql_data\podman_compose.py", line 2862, in
main()
File "C:\Users\jsparkes\sql_data\podman_compose.py", line 2858, in main
podman_compose.run()
File "C:\Users\jsparkes\sql_data\podman_compose.py", line 1383, in run
self._parse_compose_file()
File "C:\Users\jsparkes\sql_data\podman_compose.py", line 1580, in _parse_compose_file
mnt_dict = get_mnt_dict(self, cnt, volume)
File "C:\Users\jsparkes\sql_data\podman_compose.py", line 481, in get_mnt_dict
volume = parse_short_mount(volume, basedir)
File "C:\Users\jsparkes\sql_data\podman_compose.py", line 156, in parse_short_mount
raise ValueError("unknown mount option " + opt)
ValueError: unknown mount option /sql_data
```

Obviously `podman-compose `is interpreting the "C:" as the first part of the volume mapping.
This is strictly a compatability issue with Docker Compose. Docker apparently maps the "C:" into "/mnt/C" before passing it on to docker command. If I manually do that in the file, `podman-compose` works as expected.

It would be nice to be exactly compatible with docker here so that I can use the same yaml file.

`podman-compose` should transform a volumes mapping starting with "^[a-zA-Z]:" into "/mnt/$char/" before processing it to be compatible with docker compose.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.