A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/omallo/docker-volume-plugin-dostorage/tree/v0.2.0 below:

GitHub - omallo/docker-volume-plugin-dostorage at v0.2.0

Docker Volume Driver for DigitalOcean

This repo hosts the Docker Volume Driver for DigitalOcean. The driver is based on the Docker Volume Plugin framework and it integrates DigitalOcean's block storage solution into the Docker ecosystem by automatically attaching a given block storage volume to a DigitalOcean droplet and making the contents of the volume available to Docker containers running on that droplet.

The driver is written in Go and it consists of a single static binary which can be downloaded from the releases page. Appropriate binaries are made available for different Linux platforms and architectures.

For installing the driver on a DigitalOcean droplet, you will need the following before proceeding with the subsequent steps:

First, you have to download the driver's binary to the droplet and make it executable (make sure you download the binary for the appropriate release version and Linux platform/architecture):

sudo curl \
  -sSL \
  -o /usr/bin/docker-volume-plugin-dostorage \
  https://github.com/omallo/docker-volume-plugin-dostorage/releases/download/v0.2.0/docker-volume-plugin-dostorage_linux_amd64

sudo chmod +x /usr/bin/docker-volume-plugin-dostorage

Once downloaded, the driver can be started in the background as follows by providing your DigitalOcean API access token:

sudo docker-volume-plugin-dostorage --access-token=<your-API-Access-Token> &

Other command line arguments supported by the driver can be shown by invoking the driver without any argument:

sudo docker-volume-plugin-dostorage

Usage of docker-volume-plugin-dostorage:
  -t, --access-token string
        the DigitalOcean API access token
  -m, --mount-path string
        the path under which to create the volume mount folders (default "/mnt/dostorage")
  -g, --unix-socket-group string
        the group to assign to the Unix socket file (default "docker")
  --version
        outputs the driver version and exits

Docker plugins should usually be started before the Docker engine so it is advisable to restart the Docker engine after installing the driver. Depending on your Linux distribution, this can be done using either the service command

sudo service docker restart

or the systemctl command

sudo systemctl restart docker

You are now ready to use the driver for your Docker containers!

Before using the driver for your Docker containers, you must create a DigitalOcean volume. For the subsequent steps, we assume a DigitalOcean volume named myvol-01. As of now, the driver does not support volumes with multiple partitions so it is assumed that the volume consists of a single partition which you might have created e.g. as follows:

sudo mkfs.ext4 -F /dev/disk/by-id/scsi-0DO_Volume_myvol-01

An in-depth description on how to create and format DigitalOcean volumes can be found here. Please note that a DigitalOcean volume must be created and formatted manually before it can be integrated into Docker using the driver.

Once you have created and formatted your DigitalOcean volume, you can create a Docker volume using the same name (assuming a DigitalOcean volume named myvol-01):

docker volume create --driver dostorage --name myvol-01

Once the Docker volume was created, you can use it for your containers. E.g. you can list the contents of your DigitalOcean volume by mapping it to the container path /mydata as follows:

docker run --rm --volume myvol-01:/mydata busybox ls -la /mydata

You can also start an interactive shell on your container and access the contents of your DigitalOcean volume from within your container:

docker run -it --volume myvol-01:/mydata busybox sh

# the following commands are executed within the container's shell
ls -la /mydata
echo "hello world" >/mydata/greeting.txt
cat /mydata/greeting.txt
exit

Since all the changes made within the cotnainer's /mydata path are performed on the DigitalOcean volume storage device, you will not loose the changes even if you later attach the DigitalOcean volume to a different droplet.

The current status of the Docker volume can be inspected using the following command:

docker volume inspect myvol-01

The inspection command will return a result similar to the following:

[
    {
        "Name": "myvol-01",
        "Driver": "dostorage",
        "Mountpoint": "/mnt/dostorage/myvol-01",
        "Status": {
            "AttachedDropletIDs": [
                2.5355869e+07
            ],
            "ReferenceCount": 0,
            "VolumeID": "0b3aef8c-7767-11e6-a7c4-000f53315860"
        },
        "Labels": {},
        "Scope": "local"
    }
]

Apart from the standard inspection information like the local mountpoint path, the result contains a Status field with the following information (the status field is only supported with Docker version >=1.12.0):

If you use Docker in swarm mode with a cluster of droplets, you can use the driver in very much the same way as with a single droplet. The following things should be considered when using a DigitalOcean volume in a Docker cluster:

The driver logs to the STDOUT as well as to the local syslog instance (if supported). Syslog logging uses the dostorage tag.

It is advisable to use systemd to manage the startup and shutdown of the driver. Details on how to configure systemd for a Docker plugin (including socket activation), can be found here.

The following are some of the main known limitations of the driver:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4