<commit_before>[![Build Status](https://travis-ci.org/quobyte/docker-volume.svg?branch=master)](https://travis-ci.org/quobyte/docker-volume)

# Quobyte volume plug-in for Docker

This plugin allows you to use [Quobyte](www.quobyte.com) with Docker without installing the Quobyte client on the host system (e.q. Rancher/CoreOS) for more information look at [docs/coreos.md](docs/coreos.md).

## Tested

OS              | Docker Version
--------------- | :------------:
CentOS 7.2      |     1.10.3
Ubuntu 16.04    |     1.11.2
Ubuntu 16.04    |     1.12.0
CoreOS 1097.0.0 |     1.11.2

## Build

Get the code

```
$ go get -u github.com/quobyte/docker-volume
```

### Dependency Management

For the dependency management we use [golang dep](https://github.com/golang/dep)

### Linux

```
$ go build -ldflags "-s -w" -o bin/docker-quobyte-plugin .
```

### OSX/MacOS

```
$ GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o bin/docker-quobyte-plugin .
```

### Docker

```
$ docker run --rm -v "$GOPATH":/work -e "GOPATH=/work" -w /work/src/github.com/quobyte/docker-volume golang:1.8 go build -v -ldflags "-s -w" -o bin/quobyte-docker-plugin
```

## Usage

```
$ bin/docker-quobyte-plugin -h
Usage of /opt/bin/docker-quobyte-plugin:
  -api string
        URL to the API server(s) in the form http(s)://host[:port][,host:port] or SRV record name (default "http://localhost:7860")
  -group string
        Group to create the unix socket (default "root")
  -options string
        Fuse options to be used when Quobyte is mounted (default "-o user_xattr")
  -password string
        Password for the user to connect to the Quobyte API server (default "<PASSWORD>")
  -path string
        Path where Quobyte is mounted on the host (default "/run/docker/quobyte/mnt")
  -registry string
        URL to the registry server(s) in the form of host[:port][,host:port] or SRV record name (default "localhost:7861")
  -user string
        User to connect to the Quobyte API server (default "root")
```

## Setup

### Create a user in Quobyte for the plug-in:

This step is optional.

```
$ qmgmt -u <api-url> user config add docker <email>
```

### systemd

Install systemd files and set your variables in systemd/docker-quobyte.env.sample

```
$ cp systemd/docker-quobyte.env.sample /etc/quobyte/docker-quobyte.env
$ cp bin/docker-quobyte-plugin /usr/local/bin/
$ cp systemd/docker-quobyte-plugin.service /lib/systemd/system

$ systemctl daemon-reload
$ systemctl start docker-quobyte-plugin
$ systemctl enable docker-quobyte-plugin
$ systemctl status docker-quobyte-plugin
```

## Examples

### Create a volume

```
$ docker volume create --driver quobyte --name <volumename>
# Set user and group of the volume
$ docker volume create --driver quobyte --name <volumename> --opt user=docker --opt group=docker
```

### Delete a volume

```
$ docker volume rm <volumename>
```

### List all volumes

```
$ docker volume ls
```

### Attach volume to container

```
$ docker run --volume-driver=quobyte -v <volumename>:/vol busybox sh -c 'echo "Hello World" > /vol/hello.txt'
```<commit_msg>Update Readme to be more user friendly<commit_after>[![Build Status](https://travis-ci.org/quobyte/docker-volume.svg?branch=master)](https://travis-ci.org/quobyte/docker-volume)

# Quobyte volume plug-in for Docker

This plugin allows you to use [Quobyte](www.quobyte.com) with Docker without installing the Quobyte client on the host system (e.q. Rancher/CoreOS) for more information look at [docs/coreos.md](docs/coreos.md).

## Tested

OS              | Docker Version
--------------- | :------------:
CentOS 7.2      |     1.10.3
Ubuntu 16.04    |     1.11.2
Ubuntu 16.04    |     1.12.0
CoreOS 1097.0.0 |     1.11.2

## Setup

### Binary

Download the binary and the systemd files from the [releases](https://github.com/quobyte/docker-volume/releases) page. To download version `1.1` of this plugin run the following step:

```bash
curl -LO https://github.com/quobyte/docker-volume/releases/download/v1.1/docker-quobyte-plugin.tar.gz
tar xfz docker-quobyte-plugin.tar.gz
```

### Create a user in Quobyte for the plug-in:

This step is optional.

```
$ qmgmt -u <api-url> user config add docker <email>
```

### Systemd Files

Install systemd files and set your variables in systemd/docker-quobyte.env.sample

```
$ cp systemd/docker-quobyte.env.sample /etc/quobyte/docker-quobyte.env
$ cp bin/docker-quobyte-plugin /usr/local/bin/
$ cp systemd/docker-quobyte-plugin.service /lib/systemd/system

$ systemctl daemon-reload
$ systemctl start docker-quobyte-plugin
$ systemctl enable docker-quobyte-plugin
$ systemctl status docker-quobyte-plugin
```

### Usage

```
$ bin/docker-quobyte-plugin -h
Usage of /opt/bin/docker-quobyte-plugin:
  -api string
        URL to the API server(s) in the form http(s)://host[:port][,host:port] or SRV record name (default "http://localhost:7860")
  -group string
        Group to create the unix socket (default "root")
  -options string
        Fuse options to be used when Quobyte is mounted (default "-o user_xattr")
  -password string
        Password for the user to connect to the Quobyte API server (default "<PASSWORD>")
  -path string
        Path where Quobyte is mounted on the host (default "/run/docker/quobyte/mnt")
  -registry string
        URL to the registry server(s) in the form of host[:port][,host:port] or SRV record name (default "localhost:7861")
  -user string
        User to connect to the Quobyte API server (default "root")
```

## Examples

### Create a volume

```
$ docker volume create --driver quobyte --name <volumename>
# Set user and group of the volume
$ docker volume create --driver quobyte --name <volumename> --opt user=docker --opt group=docker
```

### Delete a volume

```
$ docker volume rm <volumename>
```

### List all volumes

```
$ docker volume ls
```

### Attach volume to container

```
$ docker run --volume-driver=quobyte -v <volumename>:/vol busybox sh -c 'echo "Hello World" > /vol/hello.txt'
```

## Development

### Build

Get the code

```
$ go get -u github.com/quobyte/docker-volume
```

#### Dependency Management

For the dependency management we use [golang dep](https://github.com/golang/dep)

#### Linux

```
$ go build -ldflags "-s -w" -o bin/docker-quobyte-plugin .
```

#### OSX/MacOS

```
$ GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o bin/docker-quobyte-plugin .
```

#### Docker

```
$ docker run --rm -v "$GOPATH":/work -e "GOPATH=/work" -w /work/src/github.com/quobyte/docker-volume golang:1.8 go build -v -ldflags "-s -w" -o bin/quobyte-docker-plugin
```
{'fraction_non_alphanumeric': 0.1480634339737725, 'fraction_numerical': 0.014028667276608722, 'mean_word_length': 3.2841280209013717, 'pattern_counts': {'":': 2, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1904979', 'n_tokens_mistral': 2385, 'n_tokens_neox': 2191, 'n_words': 672}