containers / containers/podman-compose
podman-compose doesn't make volume mapping
- Dominant language
- Python
- Stars
- 6.2k
- Forks
- 622
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
The volume mapping doesn't work with `docker-compose.yml` file.
Here is my `docker-compose.yml`
```yaml
services:
mongodb:
container_name: mongo
image: mongo:6.0
restart: unless-stopped
ports:
- 0.0.0.0:27017:27017
volume:
- /data/mongo:/data/db:Z
# 关闭密码验证
environment:
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=root
```
**To Reproduce**
1. mkdir -p /data/mongo
2. sudo podman-compose up -d
3. sudo podman inspect mongo | grep --color Mounts -A 40
```json
"Mounts": [
{
"Type": "volume",
"Name": "645d7f82d326e23efa5e1812f2ba34f86879eb3c9d1173158f94c46361561c55",
"Source": "/var/lib/containers/storage/volumes/645d7f82d326e23efa5e1812f2ba34f86879eb3c9d1173158f94c46361561c55/_data",
"Destination": "/data/configdb",
"Driver": "local",
"Mode": "",
"Options": [
"nodev",
"exec",
"nosuid",
"rbind"
],
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "volume",
"Name": "e4389cb94363c724b1d69bd767c778031d74a11dcf10c61edf47041feeb67697",
"Source": "/var/lib/containers/storage/volumes/e4389cb94363c724b1d69bd767c778031d74a11dcf10c61edf47041feeb67697/_data",
"Destination": "/data/db",
"Driver": "local",
"Mode": "",
"Options": [
"nodev",
"exec",
"nosuid",
"rbind"
],
"RW": true,
"Propagation": "rprivate"
}
]
```
**Expected behavior**
Make mongo store data in `/data/mongo`, not `/var/lib/containers/storage/volumes/`.
**Actual behavior**
Mongo still store data in `/var/lib/containers/storage/volumes/`
**Output**
```
$ podman-compose version
podman-compose version 1.3.0
podman version 4.9.4-rhel
$ podman --version
podman version 4.9.4-rhel
```
**Environment:**
- OS: TencentOS Server 3.1 (CentOS 9)
- podman-compose 1.3.0
- podman 4.9.4-rhel
Contributor guide
Assessment
This issue has not been assessed yet.