Docker Community Forums

Share and learn in the Docker community.

Volume Labels are absent when the volume is created using docker compose

docker
ucp

(Adityadani) #1

Following is my docker version

Client: Docker Enterprise Edition (EE) 2.0
 Version:      17.06.2-ee-16
 API version:  1.30
 Go version:   go1.8.7
 Git commit:   9ef4f0a
 Built:        Thu Jul 26 16:40:49 2018
 OS/Arch:      linux/amd64

Server: Docker Enterprise Edition (EE) 2.0
 Engine:
  Version:      17.06.2-ee-16
  API version:  1.30 (minimum version 1.12)
  Go version:   go1.8.7
  Git commit:   9ef4f0a
  Built:        Thu Jul 26 16:42:11 2018
  OS/Arch:      linux/amd64
  Experimental: false

When I create a volume using docker-compose using the following spec docker does not apply the collection.* labels

volumes:
  wp_data:
    driver: pxd
    external: false
    driver_opts:
      size: 5
      repl: 2
      shared: 'true'
      sticky: 'true'
    labels:
      com.docker.ucp.access.label: /System/Workers

The labels on the volume look like this

[
    {
        "Driver": "pxd",
        "Labels": {
            "com.docker.stack.namespace": "portworx",
            "com.docker.ucp.access.label": "/System/Workers"
        },
        "Mountpoint": "/",
        "Name": "portworx_wp_data",
        "Options": {
            "repl": "2",
            "shared": "true",
            "size": "5",
            "sticky": "true"
        },
        "Scope": "global"
    }
]

However if I create the same volume using UCP UI, I can see the correct labels

[
    {
        "Driver": "pxd",
        "Labels": {
            "com.docker.stack.namespace": "wordpress",
            "com.docker.ucp.access.label": "/System/Workers",
            "com.docker.ucp.collection": "<collection_id>",
            "com.docker.ucp.collection.<collection_id>": "true",
            "com.docker.ucp.collection.root": "true",
            "com.docker.ucp.collection.swarm": "true",
            "com.docker.ucp.collection.system": "true"
        },
        "Mountpoint": "/",
        "Name": "wordpress_db_data",
        "Options": {
            "repl": "2",
            "size": "5",
            "sticky": "true"
        },
        "Scope": "global"
    }
]

Why do I see different labels when I use docker-compose to create a volume?


(Fsejoseph) #2

Add “” around /System/Workers that might work