Using Flocker driver within Docker CLI

You can use Flocker driver within Docker CLI for volume creation and launching Docker containers.

About this task

This example illustrates creation of a new volume and launching a Docker container with the new volume.

Procedure

  1. Open a command-line terminal.
  2. Create a 10 GB volume volume_1 based on storage service gold by running the following command: docker volume create --driver=flocker --name volume_1 --opt profile=gold --opt size=10g.
  3. Launch container container_1 with volume volume_1 mounted in the /data path of the Docker container, using Docker image ubuntu by running the following command: docker run --volume-driver flocker -v volume_1:/data --name container_1 -it ubuntu bash.

    If the specified volume does not exist, the Flocker driver creates it on the Spectrum Control Base service defined in the agent.yml file, as default_service.