Skip to content

Docker compose: warning regarding postgres volume #525

@b-pfl

Description

@b-pfl

When using the provided docker-compose.yml through an ansible script, we receive the following warnings:

[WARNING]: Docker compose: unknown None: volume "zammad_postgresql-data" already exists but was not created by Docker
Compose. Use `external: true` to use an existing volume

docker volume inspect zammad_postgresql-data outputs the following information

[
    {
        "CreatedAt": "2023-01-01T20:00:00+01:00",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "/var/lib/docker/volumes/zammad_postgresql-data/_data",
        "Name": "zammad_postgresql-data",
        "Options": {},
        "Scope": "local"
    }
]

Interestingly, another volume seems to exist:
docker volume inspect zammad-docker-compose_postgresql-data

[
    {
        "CreatedAt": "2025-04-03T22:00:00+02:00",
        "Driver": "local",
        "Labels": null,
        "Mountpoint": "/var/lib/docker/volumes/zammad-docker-compose_postgresql-data/_data",
        "Name": "zammad-docker-compose_postgresql-data",
        "Options": null,
        "Scope": "local"
    }
]

When inspecting the corresponding (Zammad) PostgreSQL container, it is using zammad_postgresql-data. It looks like docker compose complains because this volume does not have any labels that indicate docker compose as a source/creator.

As a comparison:

docker volume inspect zammad_zammad-config-nginx outputs:

[
    {
        "CreatedAt": "2023-07-18T20:50:00+02:00",
        "Driver": "local",
        "Labels": {
            "com.docker.compose.project": "zammad",
            "com.docker.compose.version": "1.29.2",
            "com.docker.compose.volume": "zammad-config-nginx"
        },
        "Mountpoint": "/var/lib/docker/volumes/zammad_zammad-config-nginx/_data",
        "Name": "zammad_zammad-config-nginx",
        "Options": null,
        "Scope": "local"
    }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions