This is a quick guide and how to install the Pure plugin for docker 1.13 and above. For full details check out Pure Volume Plugin on Store.docker.com.
Operating Systems Supported
CentOS Linux 7.3
CoreOS (Ladybug 1298.6.0 and above)
Ubuntu (Trusty 14.04 LTS, Xenial 16.04.2 LTS)
Docker 1.13+ I am on 17.03-ce
Mesos 1.8 and above
Latest iSCSI initiator SW
Latest Multipath package (This made a difference for me on Ubuntu remember to update!)
Here I am just listing the Pure hosts on my array before I install the plugin.
Also listing out my volumes, these are all pre-existing.
Pull and Install the plugin (Docker 1.13 and above)
edit the file pure.json in /etc/pure-docker-plugin and add your array and API token
to get a token from the Pure CLI – (or go to the GUI of the array and copy the API token for your user).
pureeadmin create –api-token [user]
pureadmin list –api-token [user] –expose
Pull the plugin and Install
docker plugin install store/purestorage/docker-plugin:1.0 –alias pure
Grant the plugins to the directories it requests.
For Docker Swarm
Setting the PURE_DOCKER_NAMESPACE variable can be done with the command:
docker plugin set pure PURE_DOCKER_NAMESPACE=<clusterid>
My next blog post will dive more into setting up the plugin with Docker Swarm. The clusterid is just a unique string. Keep it simple.
$docker volume create -d pure -o size=200GiB Demo
Remember if you want to create the volume with other units the information is in the README but here it is for now:<Units can be specified as xB, xiB, or x. If no units are specified MiB is assumed.
My host created by the plugin
Now that I created a volume on the array the host docker01 is now added to the list of hosts. The plugin automates adding the iSCSI IQN and creating the host.
My new volume all ready to go
You also see the docker01-Demo is listed and sized to my requested 200GiB The PURE_DOCKER_NAMESPACE will prepend the volume name you create. The default will use the docker hostname. In a Mesos and Swarm environment the namespace setting mentioned above is used. This is only identified this way on the array.
Now the volume can be mounted to a container using
#docker run –volume Demo:/data [image] [command]
You could also create a new volume and mount it to a container all in the same line with:
#docker run –volume-driver pure –volume myvolume:/data [image] [command]