Class NetworkSpec

java.lang.Object
io.github.pgatzka.docker.dsl.spec.NetworkSpec
All Implemented Interfaces:
org.gradle.api.Named

public abstract class NetworkSpec extends Object implements org.gradle.api.Named
Spec describing a Docker network the plugin will create and manage. Instantiated by Gradle's ObjectFactory for each name registered in docker { networks { register(...) }}.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Constructor Summary

    Constructors
    Constructor
    Description
    Invoked by Gradle's ObjectFactory when a network is registered.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.provider.Property<Boolean>
    Whether non-service containers may attach to the network (--attachable).
    abstract org.gradle.api.provider.Property<String>
    Network driver passed to docker network create --driver.
    abstract org.gradle.api.provider.Property<Boolean>
    Whether the network is --internal (no outbound connectivity).
    abstract org.gradle.api.provider.MapProperty<String,String>
    Labels applied to the network as --label KEY=VALUE pairs.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NetworkSpec

      @Inject public NetworkSpec(String name)
      Invoked by Gradle's ObjectFactory when a network is registered. Defaults driver to "bridge" and both internal and attachable to false.
      Parameters:
      name - logical network name as registered in the DSL
  • Method Details

    • getDriver

      public abstract org.gradle.api.provider.Property<String> getDriver()
      Network driver passed to docker network create --driver. Defaults to "bridge".
      Returns:
      the driver property
    • getLabels

      public abstract org.gradle.api.provider.MapProperty<String,String> getLabels()
      Labels applied to the network as --label KEY=VALUE pairs.
      Returns:
      the labels property
    • getInternal

      public abstract org.gradle.api.provider.Property<Boolean> getInternal()
      Whether the network is --internal (no outbound connectivity). Defaults to false.
      Returns:
      the internal property
    • getAttachable

      public abstract org.gradle.api.provider.Property<Boolean> getAttachable()
      Whether non-service containers may attach to the network (--attachable). Defaults to false.
      Returns:
      the attachable property
    • getName

      public String getName()
      Specified by:
      getName in interface org.gradle.api.Named