mauron85
mauron85

Reputation: 1544

Volume not really mounted to docker container on IBM Bluemix

I've created volume with:

cf ic volume create VOLNAME

And tried to assigned it to container group:

cf ic group create --name mygroup --memory 256 --max 1 --desired 1 \
--volume VOLNAME:/usr/src/app/db/ \
--hostname mygreatapp \
registry.ng.bluemix.net/bs/mygreatapp

But VOLNAME was not assigned to container group. When I check with docker inspect containerId. I see no volumes for container:

[{
  "Volumes": {},
  "VolumesRW": {}
}]

When I create group from dashboard and assign volume from there, the dashboard shows volume and mount point, but again docker inspect containerId claims opposite.

As result I cannot use volume in Bluemix.

Upvotes: 0

Views: 168

Answers (1)

jimmc
jimmc

Reputation: 585

A storage volume bound to a container group is shared by the containers in the group. You will not see the volume for an individual container; however, if you inspect the attributes for the container group, you will see the volume associated with the group of containers.

The cf ic group inspect command should show something similar to the output below (snipped for relevance and brevity):

$> cf ic group inspect myContainerGroup
{
  "Cmd": [],
  "Creation_time": "2015-10-17T20:00:00Z",
  "Env": [
    "sgroup_name=myContainerGroup",
    ...
  ],
  ...
  "Volumes": [
    "VOLNAME:/usr/src/app/db"
  ]
}

Upvotes: 2

Related Questions