on your EC2 instance, install REX-Ray using:
$ curl -sSL https://dl.bintray.com/emccode/rexray/install | sh -s -- stable 0.3.3
REX-Ray is installed. Create a new configuration file and add the following contents:
$ sudo vi /etc/rexray/config.yml
rexray:
storageDrivers:
- ec2
aws:
accessKey: MyAccessKey
secretKey: MySecretKey
Start the service:
$ sudo rexray start
That's it!
Now you can do volume functionality using the rexray cli or Docker cli
$ docker volume create -d rexray --name hello --opt=size=5
$ docker run -ti --volume-driver=rexray -v hello:/hello busybox