Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source path is not contained in array "mounts" when querying a container #102

Open
gitmors opened this issue Jul 6, 2023 · 1 comment
Open

Comments

@gitmors
Copy link

gitmors commented Jul 6, 2023

Good day,

I have noticed that when I query information about a container via the docker API so something like this 'GET /containers/{id}/json' then I get back an object which contains among other things an array called "Mounts". In this array each volume is contained as a separate object, for example:

[{
"Destination":"/container/path",
"Driver": "local-persist",
"Mode":"",
"Name": "test",
"Propagation":""
"RW":true,
"Source":"",
"Type": "volume"
}]

Unfortunately, the "Source":"" (source path) is not transferred here. With the default driver "local" it is. Unfortunately I need this value for one of my queries. Maybe there is a quick solution for this problem.

LocalPersist

Thank you.
Regards

@ThaDaVos
Copy link

ThaDaVos commented Nov 18, 2023

Running into the same issue with using OneDev Job Executor - "Source": "" - causes it to fail - but it seems, this is only empty when the volume is created through docker-compose - as I have a volume used for portainer using local-persist which has Source set - inspections of both show no obvious differences except the labels:

Portainer:

[
    {
        "CreatedAt": "0001-01-01T00:00:00Z",
        "Driver": "local-persist",
        "Labels": {},
        "Mountpoint": "{MOUNT_POINT}",
        "Name": "portainer_data",
        "Options": {
            "mountpoint": "{MOUNT_POINT}"
        },
        "Scope": "local"
    }
]

Onedev Agent:

[
    {
        "CreatedAt": "0001-01-01T00:00:00Z",
        "Driver": "local-persist",
        "Labels": {
            "com.docker.compose.project": "source-control",
            "com.docker.compose.version": "2.20.2",
            "com.docker.compose.volume": "onedev_agent_work"
        },
        "Mountpoint": "{MOUNT_POINT}",
        "Name": "source-control_onedev_agent_work",
        "Options": {
            "mountpoint": "{MOUNT_POINT}"
        },
        "Scope": "local"
    }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants