Rancher catalog, GlusterFS, how to choose where bricks get created?

Well, I did something like this:

Reviewing https://github.com/rancher/catalog-dockerfiles/blob/master/glusterfs/0.2.0/docker-compose.yml, I realized that glusterfs uses a data volume container:

glusterfs-data:
  image: rancher/glusterfs:v0.1.3
  command: /bin/true
  volumes:
    - /var/run
  labels:
    io.rancher.container.hostname_override: container_name
    io.rancher.container.start_once: true

So, I check the image’s Dockerfile (https://github.com/rancher/catalog-dockerfiles/blob/master/glusterfs/containers/0.1.3/glusterfs/Dockerfile). It has the line:

VOLUME ["/data/glusterfs/brick1"]

As I didn’t find the way to parameterize this volume, I ended up creating a private catalog cloning rancher’s glusterfs catalog and adding the following “volume” line in docker-compose.yml:

Before:

glusterfs-data:
  image: rancher/glusterfs:v0.1.3
  command: /bin/true
  volumes:
    - /var/run
  labels:
    io.rancher.container.hostname_override: container_name
    io.rancher.container.start_once: true

After:

glusterfs-data:
  image: rancher/glusterfs:v0.1.3
  command: /bin/true
  volumes:
    - /var/run
    - /storage/glusterfs/brick1:/data/glusterfs/brick1
  labels:
    io.rancher.container.hostname_override: container_name
    io.rancher.container.start_once: true

/storage/glusterfs/brick1 is the host’s directory where I mounted my /dev/sdb1 partition.

That worked but,… I’d prefer that I could specify the directory I want to use as gluster’s brick.

There’s a new version of glusterfs catalog. I’ll try it.