Creating and removing volumes

The Fabric8 Maven Docker plugin couldn't be a complete solution without the possibility of managing volumes. Indeed, it provides two ways to handle volumes: docker:volume-create and docker:volume-remove. As you probably remember from Chapter 2, Networking and Persistent Storage, Docker uses a plugin-like architecture when handling volumes and their drivers. The fabric8 plugin can be configured to pass a specific volume driver and its parameters to the Docker daemon. Consider the following fragment of the plugin configuration:

<plugin>
    
        <configuration>
    
    
          [...]
    
    
          <volumes>
    
    
            <volume>
    
    
              <name>myVolume</name>
    
    
              <driver>local</driver>
    
    
              <opts>
    
    
                <type>tmpfs</type>
    
    
                <device>tmpfs</device>
    
    
       <o>size=100m,uid=1000</o> ...

Get Docker and Kubernetes for Java Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.